Closed
Bug 875433
Opened 12 years ago
Closed 9 years ago
Array.prototype[@@iterator] should be the same function object as Array.prototype.values
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla25
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: bbenvie, Assigned: jorendorff)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete)
Attachments
(2 files, 1 obsolete file)
1.67 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
3.15 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
The ES6 spec states:
> Array.prototype[@@iterator]()
> The initial value of the @@iterator property is the same function object as the initial value of the Array.prototype.values property.
> Map.prototype[@@iterator]()
> The initial value of the @@iterator property is the same function object as the initial value of the Map.prototype.entries property.
> Set.prototype[@@iterator ]()
> The initial value of the @@iterator property is the same function object as the initial value of the Set.prototype.values property.
Ignoring the fact that SpiderMonkey currently isn't using a Symbol for the @@iterator property under the assumption that the string keyed "iterator" is a temporary stand-in for it, these departures from the ES6 spec can be observed:
> Array.prototype.entries !== Array.prototype.iterator;
> Array.prototype.iterator.name !== "entries";
> Map.prototype.entries !== Map.prototype.iterator;
> Map.prototype.iterator.name !== "entries";
(Set.{keys, values, entries} is not implemented yet, bug 869996)
Reporter | ||
Comment 1•12 years ago
|
||
Apologies, a correction. This should be observed for Array:
> Array.prototype.values !== Array.prototype.iterator;
> Array.prototype.iterator.name !== "values";
Comment 2•12 years ago
|
||
This should patch should fix the Array.prototype deviations from the ES6 spec.
The rest of the problem for Map and Set should go away once the patch on the bug 869996 has been landed.
Assignee | ||
Updated•12 years ago
|
Attachment #754135 -
Flags: review?(jorendorff) → review+
Comment 3•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Updated•12 years ago
|
Keywords: dev-doc-needed
Assignee | ||
Comment 4•12 years ago
|
||
Adding Array.prototype.values caused some surprising compatibility issues (bug 881782, bug 883914). I think we need to do a partial backout before FF24. I intend to do so tomorrow unless the plot develops further.
I've mentioned this to es-discuss, as well -- the method we added that seems to be causing the problems is standard-track. Presumably that will change.
Depends on: 883914
Assignee | ||
Comment 5•12 years ago
|
||
Backed out for now. No real discussion on es-discuss yet.
https://hg.mozilla.org/integration/mozilla-inbound/rev/38f0844975f2
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 6•12 years ago
|
||
(In reply to Jason Orendorff [:jorendorff] from comment #5)
> Backed out for now. No real discussion on es-discuss yet.
> https://hg.mozilla.org/integration/mozilla-inbound/rev/38f0844975f2
Merge of backout:
https://hg.mozilla.org/mozilla-central/rev/38f0844975f2
Comment 7•12 years ago
|
||
[clearing milestone and in-testsuite, since this has been backed out]
Flags: in-testsuite+ → in-testsuite?
Target Milestone: mozilla24 → ---
Assignee | ||
Comment 8•12 years ago
|
||
I'm sure Sencha is working on fixing Ext JS but that won't fix existing web sites without further outreach.
The attitude on es-discuss seems to be "wait and see", so this could be in limbo for a long time. Setting need-info from dherman, one of our TC39 members.
Flags: needinfo?(dherman)
Reporter | ||
Comment 9•12 years ago
|
||
Having Array.prototype.values has limited usefulness as long as you have Array.prototype.@@iterator (or just "iterator" in our case currently). Perhaps we could spin this bug off into two bugs: one for Array.prototype.values which is in limbo, and one for the rest which is not.
Reporter | ||
Comment 10•12 years ago
|
||
Oh nevermind, Map/Set was done elsewhere. Ignore my last comment.
Reporter | ||
Updated•12 years ago
|
Summary: iterator methods of [Array, Map, Set].prototype should be same function object as entries/values → Array.prototype.iterator should be the same function object as Array.prototype.values
Assignee | ||
Comment 11•12 years ago
|
||
Trying again, now that FF24 has branched.
https://hg.mozilla.org/integration/mozilla-inbound/rev/b4426d926b31
Comment 12•12 years ago
|
||
Please use hg out to check the commit message before you push. This one got a bit munged.
Comment 13•12 years ago
|
||
So, is there a plan to address the site regressions from comment 4? Are those going to become tech evang issues?
Comment 14•12 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #13)
> So, is there a plan to address the site regressions from comment 4? Are
> those going to become tech evang issues?
Sencha is aware of the issue and working on a fix. Once they have that, a roll out to regressing sites is hopefully going to be fairly painless, and hence quick. Hopefully.
Comment 15•12 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Comment 16•12 years ago
|
||
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 17•11 years ago
|
||
Just for completeness, and because it confused someone on another bug, here's the m-c changeset for Comment 16's backout:
https://hg.mozilla.org/mozilla-central/rev/22c3433bdbc9
Comment 18•11 years ago
|
||
Should this bug be closed (or morphed?) as a result of bug 881782 comment 22?
Assignee | ||
Comment 19•11 years ago
|
||
No, keep this open.
TC39 is designing a truly gruesome workaround for this. Eventually it'll be done and we'll implement, and then we can re-land the patch here.
Updated•11 years ago
|
Keywords: site-compat
Comment 20•11 years ago
|
||
We can try relanding this once bug 1054759 is fixed.
Depends on: 1054759
Flags: needinfo?(dherman)
Comment 21•9 years ago
|
||
Next time let's land this together with bug 1258163.
Assignee: sankha93 → evilpies
Attachment #754135 -
Attachment is obsolete: true
Comment 22•9 years ago
|
||
Attachment #8732611 -
Flags: review?(jorendorff)
Summary: Array.prototype.iterator should be the same function object as Array.prototype.values → Array.prototype[@@iterator[ should be the same function object as Array.prototype.values
Summary: Array.prototype[@@iterator[ should be the same function object as Array.prototype.values → Array.prototype[@@iterator] should be the same function object as Array.prototype.values
Assignee | ||
Comment 23•9 years ago
|
||
Comment on attachment 8732611 [details] [diff] [review]
Add Array.prototype.values
Review of attachment 8732611 [details] [diff] [review]:
-----------------------------------------------------------------
r=me. I had this in my patch for a while, but didn't realize we had _SetCanonicalName -- so I didn't expect it to work -- so I removed it. Nice!
Attachment #8732611 -
Flags: review?(jorendorff) → review+
Assignee | ||
Comment 24•9 years ago
|
||
I'll land this when I reland @@unscopables, hopefully Monday.
Comment 25•9 years ago
|
||
I think I forgot to add values to test_xrayToJS.xul.
Assignee | ||
Comment 26•9 years ago
|
||
Yeah, I expected that. I'll add it before pushing to the try server.
Assignee | ||
Comment 27•9 years ago
|
||
Attachment #8732889 -
Flags: review?(bobbyholley)
Assignee | ||
Updated•9 years ago
|
Assignee: evilpies → jorendorff
Status: REOPENED → ASSIGNED
Assignee | ||
Comment 28•9 years ago
|
||
Comment 29•9 years ago
|
||
Comment on attachment 8732889 [details] [diff] [review]
Implement Array.prototype.values
Review of attachment 8732889 [details] [diff] [review]:
-----------------------------------------------------------------
r=me on the xray bits. Everything else looks fine, but I don't know the spec well enough to confirm that this matches it.
Attachment #8732889 -
Flags: review?(bobbyholley) → review+
Assignee | ||
Comment 30•9 years ago
|
||
Comment 31•9 years ago
|
||
I added the site-compat keyword 2 years ago but is there still any chance of breaking site compatibility here?
Assignee | ||
Comment 32•9 years ago
|
||
Not with @@unscopables in place, no.
Assignee | ||
Comment 34•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/ee890a109435989837df6bf7b860203bbe80ff4b
Bug 875433 - Implement Array.prototype.values. r=jorendorff.
Comment 35•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 12 years ago → 9 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Comment 36•9 years ago
|
||
https://developer.mozilla.org/en-US/Firefox/Releases/48#JavaScript
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•