Closed Bug 1462741 Opened 7 years ago Closed 7 years ago

Function.prototype.toString() is not displayed as a native function

Categories

(Core :: JavaScript: Standard Library, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: anba, Assigned: evilpies)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 2 obsolete files)

https://github.com/tc39/test262/blob/master/test/built-ins/Function/prototype/toString/well-known-intrinsic-object-functions.js expects that |Function.prototype.toString()| returns the string representation of a native function. Test case: --- print(Function.prototype.toString()); --- Expected: "function () {\n [native code]\n}" Actual: "function () {\n}"
Blocks: 1317400
I wonder if this means that we can make Function.prototype a real native function, instead of an interpreted function: https://searchfox.org/mozilla-central/rev/3fdc51e66c9487b39220ad58dcee275fca070ccd/js/src/vm/JSFunction.cpp#857
Interesting behaviour change from this: Function.prototype.{arguments, caller} now throw, because it's a native (built-in) function. Chrome also behaves like this, so it's probably web-compatible.
Assignee: nobody → evilpies
Attached patch Test changes (obsolete) — Splinter Review
Various debugger tests were observing Function.prototype.
Depends on D14704
Attachment #9030018 - Attachment is obsolete: true
Attachment #9030019 - Attachment is obsolete: true
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/7d987ede1c79 Make Function.prototype a native function. r=jorendorff https://hg.mozilla.org/integration/autoland/rev/f23ff3309649 Update tests. r=jorendorff
I still need to update jstests.list
Keywords: leave-open
Keywords: leave-open
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
See Also: → 1755406
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: