Retrieving generator references

Andy Wingo wingo at igalia.com
Fri Nov 28 03:58:09 PST 2014


On Sun 23 Nov 2014 12:54, Alex Kocharin <alex at kocharin.ru> writes:

> Hmm... Interestingly, in Chrome if you do call it with 'new', 'this'
> would refer to a generator itself. But not in FireFox. I'm playing
> around with this example:
> ```
> function *G() {
> console.log(this === x)
> yield 1
> console.log(this === x)
> }
> x = new G()
> x.next()
> x.next()
> ```
> Shows "true, true" for V8 and "false, false" for FF engine.

This is a bug in SM: https://bugzilla.mozilla.org/show_bug.cgi?id=907742

Andy




More information about the es-discuss mailing list