Closed Bug 907742 Opened 12 years ago Closed 9 years ago

In "new g()", bind generator object to "this".

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

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()
I just spent 15 minutes confirming that this is in fact what happens, per the current spec text.
Well, 15 minutes plus 5 years training myself on how to read ES-spec-ese.
See https://bugs.ecmascript.org/show_bug.cgi?id=1489 for more discussion on this issue.
Assignee: general → nobody
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.