Closed Bug 1084001 Opened 11 years ago Closed 11 years ago

Promise.name is an empty string, it should be "Promise"

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: marco, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

I think this is a regression because I remember testing it when fixing bug 1028987. I'm not entirely sure though.
It's not a regression.
Keywords: regression
This has more to do with how the bindings set up the "function" Promise.
Component: JavaScript Engine → DOM
This is similar to https://www.w3.org/Bugs/Public/show_bug.cgi?id=22392 but not identical. Needs a Web IDL spec issue, I believe; right now per web IDL interface objects do not have .name. Then again, I see nothing in ES6 that says that Promise should have a .name either, though I could be missing it.
Ah, here's the relevant es6 bit, courtesy of Tom: Every built-in Function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification. We should just align both our impl and Web IDL with this.
And: Unless otherwise specified, the name property of a built-in Function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Oh, and a note: The JSPROP_PERMANENT went away to align with the ES6 spec. Spidermonkey has outstanding bugs to do so too.
And another note: evilpie suggested maybe interning instead of copying here, since we'll atomize anyway when we go to define on the global.
Comment on attachment 8506376 [details] [diff] [review] Set the .name of DOM interface objects to the name of the interface Review of attachment 8506376 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bindings/BindingUtils.cpp @@ +464,5 @@ > + return nullptr; > + } > + > + JS::Rooted<JSString*> nameStr(cx, > + JS_NewStringCopyZ(cx, name)); Yeah, interning seems fine.
Attachment #8506376 - Flags: review?(peterv) → review+
Flags: in-testsuite+
Target Milestone: --- → mozilla36
And https://hg.mozilla.org/integration/mozilla-inbound/rev/4506af8e95fd to back out the JSPROP_PERMANENT change, because imptests are silly. I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1089079 to track doing that.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
Duplicate of this bug: 953302
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: