Closed
Bug 1091945
Opened 11 years ago
Closed 10 years ago
%IteratorPrototypeObject% should not be Iterator.prototype
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 1225396
People
(Reporter: evilpies, Unassigned)
References
Details
Attachments
(1 file)
19.93 KB,
patch
|
wingo
:
feedback+
|
Details | Diff | Splinter Review |
Right now %IteratorPrototypeObject% is Iterator.prototype. I think it would be better for %IteratorPrototypeObject% to be a distinct object. "Iterator" is kind of legacy and shouldn't pollute %IteratorPrototypeObject% with e.g. the legacy next method.
Reporter | ||
Comment 1•11 years ago
|
||
Reporter | ||
Comment 2•11 years ago
|
||
Comment on attachment 8514692 [details] [diff] [review]
WIP
What do you think of this idea?
Attachment #8514692 -
Flags: feedback?(wingo)
Comment 3•11 years ago
|
||
Comment on attachment 8514692 [details] [diff] [review]
WIP
Review of attachment 8514692 [details] [diff] [review]:
-----------------------------------------------------------------
I don't really know. It could make sense to have an Iterator object in some future ES. OTOH it probably shouldn't be the current Iterator object, as Iterator.prototype does the StopIteration thing, so you're probably right there. feedback+ on my side then.
::: js/src/jsiter.cpp
@@ +1251,5 @@
> nullptr /* construct */
> };
>
> /* static */ bool
> +GlobalObject::initLegayIteratorClass(JSContext *cx, Handle<GlobalObject *> global)
"legacy"
@@ +1311,5 @@
> JSObject *
> js_InitIteratorClasses(JSContext *cx, HandleObject obj)
> {
> Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
> + if (!GlobalObject::initLegayIteratorClass(cx, global))
"legacy"
::: js/src/vm/GlobalObject.h
@@ +448,5 @@
> return &self->getSlot(slot).toObject();
> }
>
> public:
> + // todo should be nativeobject
what does this mean?
Attachment #8514692 -
Flags: feedback?(wingo) → feedback+
Reporter | ||
Updated•11 years ago
|
Assignee: evilpies → nobody
Comment 5•10 years ago
|
||
Patches in bug 1225396 address this.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•