Closed
Bug 1084019
Opened 9 years ago
Closed 9 years ago
ES6 "name" property of functions should be configurable
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: bzbarsky, Assigned: till)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete, Whiteboard: [DocArea=JS])
Attachments
(1 file)
8.50 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #911142 +++ Just like bug 911142 but for "name". Simple tests: Object.getOwnPropertyDescriptor(Object, "name").configurable Object.getOwnPropertyDescriptor(function foo(){}, "name").configurable
Assignee | ||
Comment 1•9 years ago
|
||
We had one really short test covering the previous behavior, it seems. I removed that and added tests covering everything I could think of. Slightly bungled (wrong commit message, forgot the reportCompare song-and-dance) try-run without web platform tests here: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=b6348b75b5b7 New try run with issues fixed, but containing just the web platform tests: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=3310bb12900e This builds on top of the similar patch for "length", so should land after or with that.
Attachment #8536237 -
Flags: review?(jorendorff)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → till
Status: NEW → ASSIGNED
Comment 2•9 years ago
|
||
Comment on attachment 8536237 [details] [diff] [review] Make the "name" property of function objects configurable Review of attachment 8536237 [details] [diff] [review]: ----------------------------------------------------------------- Cool. Thanks. ::: js/src/jsfun.cpp @@ +489,5 @@ > if (isLength || JSID_IS_ATOM(id, cx->names().name)) { > MOZ_ASSERT(!IsInternalFunctionObject(obj)); > > RootedValue v(cx); > + // Since f.length and f.name are configurable, they could be resolved Blank line before this comment, please, as required by the style guide (except when the preceding line ends with '{'). ::: js/src/tests/ecma_6/Function/function-name.js @@ +6,5 @@ > + assertEq(f.name, ''); > + assertEq(f.hasOwnProperty('name'), false); > + f.name = 'g'; > + assertEq(f.name, ''); > + Object.defineProperty(f, 'name', {value: 'g'}); Could add one more assertion after this, since it should succeed in defining a new 'name' property. assertEq(f.name, 'g'); or something.
Attachment #8536237 -
Flags: review?(jorendorff) → review+
Assignee | ||
Comment 3•9 years ago
|
||
Thanks for the review! remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/be17c68f88cb
Comment 4•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/be17c68f88cb
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Comment 5•9 years ago
|
||
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name https://developer.mozilla.org/en-US/Firefox/Releases/38#JavaScript
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•