4.6.88. Just tried it in v8 shell. myIterable[Symbol.iterator].next is undefined.
On Tuesday, November 3, 2015 at 3:40:07 PM UTC-8, Ben Noordhuis wrote: > > On Wed, Nov 4, 2015 at 12:17 AM, Jane Chen <[email protected] > <javascript:>> wrote: > > With the change of behavior in Iterator discussed here: > > > > https://groups.google.com/forum/#!topic/v8-users/8LkrofVr0aA > > > > If I have an iterator (natively defined) which supports for ... of loop, > > what is the equivalent of calling next to advance it? > > > > I hope the following js example demonstrates what I mean: > > > >> myIterable[Symbol.iterator] = function* () {yield 1;} > > function* () {yield 1;} > >> for (var k of myIterable) print(k); > > 1 > >> myIterable[Symbol.iterator]; > > function* () {yield 1;} > >> myIterable[Symbol.iterator].next(); > > (shell):1: TypeError: myIterable[Symbol.iterator].next is not a function > > myIterable[Symbol.iterator].next(); > > ^ > > TypeError: myIterable[Symbol.iterator].next is not a function > > at (shell):1:29 > > What version of V8 is that? It works in 4.6. > -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
