Closed
Bug 1168260
Opened 10 years ago
Closed 9 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: evilpies)
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•10 years ago
|
||
As of today, Promises in Firefox are implemented on the DOM side, not in JS.
Component: JavaScript Engine → DOM
Comment 2•10 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•10 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•10 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•10 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•9 years ago
|
Blocks: es6promises
| Assignee | ||
Comment 6•9 years ago
|
||
Fixed with bug 911216:
js> Object.keys(Promise.prototype).length
0
js> Object.keys(Promise).length
0
| Assignee | ||
Updated•9 years ago
|
Component: DOM → JavaScript: Standard Library
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → evilpies
Comment 7•9 years ago
|
||
Why is this bug (and bug 1237762) still open?
| Assignee | ||
Comment 8•9 years ago
|
||
Attachment #8778172 -
Flags: review?(till)
Comment 9•9 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•9 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•9 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 9 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
•