Closed
Bug 570382
Opened 14 years ago
Closed 14 years ago
TM: Function.prototype.toString doesn't work with proxy functions
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: gal, Unassigned)
Details
At least Function.prototype.toString doesn't work right on callable objects. ES5 says that callable objects are of type Function (typeof RegExp == "function"), so this should probably made work. We should check for isCallable instead of isFunction.
Reporter | ||
Comment 1•14 years ago
|
||
"An implementation-dependent representation of the function is returned. This representation has the syntax of a FunctionDeclaration. Note in particular that the use and placement of white space, line terminators, and semicolons within the representation String is implementation-dependent.
The toString function is not generic; it throws a TypeError exception if its this value is not a Function object. Therefore, it cannot be transferred to other kinds of objects for use as a method."
Looks like ES5 doesn't want all callable objects to be allowed here, only explicitly functions. So I will fix this narrowly for proxies.
Comment 2•14 years ago
|
||
Please resummarize -- summary is wrong, ES1-5 are clear on this :-P.
/be
Reporter | ||
Updated•14 years ago
|
Summary: TM: Function.prototype.* doesn't work on callable objects → TM: Function.prototype.* doesn't work with proxy functions
Reporter | ||
Updated•14 years ago
|
Summary: TM: Function.prototype.* doesn't work with proxy functions → TM: Function.prototype.toString doesn't work with proxy functions
Comment 3•14 years ago
|
||
Works for Proxies and Functions, Ecma doesn't want anything more.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•