Ticket #64 (new defect)

Opened 2 years ago

Last modified 1 year ago

Function.prototype.toString is just a stub

Reported by: lth Assigned to: lth
Type: defect Priority: major
Milestone: M1 Component: RefImpl
Version: 4 Keywords:
Cc: jeffdyer, graydon, chrispi

Description

The method only produces function () { } whatever the actual definition of the function.

Attachments

Change History

Changed 2 years ago by lth

  • owner set to lth

Changed 2 years ago by lth

  • cc changed from jeffdyer,graydon to jeffdyer, graydon, chrispi

Easiest way to fix this is if the parser snarfs the text for the function out of the input with the help of the lexer, based on the token positions reported during parsing, and passes this along as a field of the Ast.FUNC, so that when the function is created the "source" property in the Function is set to that string.

Alternatively, the source code is obtainable through a magic call on the function object; that is probably cleaner.

Changed 1 year ago by chrispi

I'm pushing the source coordinates forward through the parser far enough so that Ast.FUNC actually has a meaningful Ast.LOC.

Changed 1 year ago by chrispi

Ok, those changes are now pushed. We should be able to use the LOC to get the source coordinates of the source file.

Note: See TracTickets for help on using tickets.