Closed
Bug 907742
Opened 12 years ago
Closed 9 years ago
In "new g()", bind generator object to "this".
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: wingo, Unassigned)
References
Details
In ES6, this should be { value: 1 }, but it is currently { } because this is undefined, and thus this.x is undefined as well.
function g18() {
function* g() { yield this.x; yield this.y; }
var iter = new g;
iter.x = 1;
iter.y = 2;
return iter;
}
g18().next()
Blocks: harmony:generators
Comment 1•11 years ago
|
||
I just spent 15 minutes confirming that this is in fact what happens, per the current spec text.
Comment 2•11 years ago
|
||
Well, 15 minutes plus 5 years training myself on how to read ES-spec-ese.
Reporter | ||
Comment 3•11 years ago
|
||
See https://bugs.ecmascript.org/show_bug.cgi?id=1489 for more discussion on this issue.
Assignee | ||
Updated•11 years ago
|
Assignee: general → nobody
Comment 4•9 years ago
|
||
Generators are no longer constructors (bug 1191486) - resolving as Won't Fix.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•