Closed
Bug 1168260
Opened 9 years ago
Closed 8 years ago
Promise constructor methods should not be enumerable
Categories
(Core :: JavaScript: Standard Library, defect)
Tracking
()
RESOLVED
FIXED
mozilla51
Tracking | Status | |
---|---|---|
firefox51 | --- | fixed |
People
(Reporter: ljharb, Assigned: evilpie)
References
Details
Attachments
(1 file)
570 bytes,
patch
|
till
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3 Steps to reproduce: `Object.keys(Promise).length === 0 && !['resolve', 'reject', 'all', 'race'].map(k => Promise.propertyIsEnumerable(k)).some(Boolean)` Actual results: `false` Expected results: `true`
Comment 1•9 years ago
|
||
As of today, Promises in Firefox are implemented on the DOM side, not in JS.
Component: JavaScript Engine → DOM
Comment 2•9 years ago
|
||
We could add something in Web IDL to make things non-enumerable.... or we could just wait until SpiderMonkey in fact implements promises like it should. Unless there's an urgent need to fix this, I would rather just do the latter. That said, Cameron, are there any plans to add a way to annotate things as non-enumerable in IDL?
Comment 3•9 years ago
|
||
(In reply to Not doing reviews right now from comment #2) > That said, Cameron, are there any plans to add a way to annotate things as > non-enumerable in IDL? No plans to add this currently. Of course, that doesn't need to affect whether we support such a way in our bindings so that we can fix these Promise methods.
Flags: needinfo?(cam)
Comment 4•9 years ago
|
||
This bug was filed for constructor methods, but the exact same issue exists for instance methods: Object.keys(Promise.prototype).length // should be 0, is currently 2
Comment 5•9 years ago
|
||
Yes, it's the exact same issue. The difference between ES6 builtins and web platform builtins in this regard is quite vexing.
Updated•8 years ago
|
Blocks: es6promises
Assignee | ||
Comment 6•8 years ago
|
||
Fixed with bug 911216: js> Object.keys(Promise.prototype).length 0 js> Object.keys(Promise).length 0
Assignee | ||
Updated•8 years ago
|
Component: DOM → JavaScript: Standard Library
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → evilpies
Comment 7•8 years ago
|
||
Why is this bug (and bug 1237762) still open?
Assignee | ||
Comment 8•8 years ago
|
||
Attachment #8778172 -
Flags: review?(till)
Comment 9•8 years ago
|
||
Comment on attachment 8778172 [details] [diff] [review] Test: Promise methods are not enumerable Review of attachment 8778172 [details] [diff] [review]: ----------------------------------------------------------------- Thank you.
Attachment #8778172 -
Flags: review?(till) → review+
Comment 10•8 years ago
|
||
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/ab210b9e2172 Test: Promise methods should not be enumerable. r=till
Comment 11•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ab210b9e2172
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in
before you can comment on or make changes to this bug.
Description
•