Closed
Bug 1197094
Opened 10 years ago
Closed 10 years ago
ForOfIterator calls ToObject on iterable
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla45
People
(Reporter: anba, Assigned: mrrrgn)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
2.10 KB,
patch
|
evilpies
:
review+
|
Details | Diff | Splinter Review |
Test case:
---
Object.defineProperty(Number.prototype, Symbol.iterator, {
value() {
"use strict";
print("typeof", typeof this);
return { next() { return {done: true}; } };
}
});
new Map(0);
---
Expected: Prints "typeof number"
Actual: Prints "typeof object"
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → winter2718
Assignee | ||
Comment 1•10 years ago
|
||
A nice gimme to end the week with.
Assignee | ||
Comment 2•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Attachment #8696100 -
Flags: review?(evilpies)
Comment 3•10 years ago
|
||
Comment on attachment 8696100 [details] [diff] [review]
forofobj.diff
Review of attachment 8696100 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/vm/ForOfIterator.cpp
@@ +57,4 @@
>
> RootedValue callee(cx);
> RootedId iteratorId(cx, SYMBOL_TO_JSID(cx->wellKnownSymbols().iterator));
> if (!GetProperty(cx, iterableObj, iterableObj, iteratorId, &callee))
I wonder if we need to change this to iterable as well in the future.
Attachment #8696100 -
Flags: review?(evilpies) → review+
Comment 5•10 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in
before you can comment on or make changes to this bug.
Description
•