Status: Accepted
Owner: [email protected]
CC: [email protected],  [email protected],  [email protected]
Labels: Type-Bug Priority-Medium

New issue 3484 by [email protected]: yield* should only propagate throw() if iterator has throw() implementation
http://code.google.com/p/v8/issues/detail?id=3484

Sadly, it seems that our yield* implementation is incomplete, even after http://code.google.com/p/v8/issues/detail?id=3422 is fixed. Consider:

  var o = (function* () { yield* [1,2,3] })()
  o.next() // -> { value: 1, done: false }
  o.throw("foo")

The expectation is that the generator checks for the presence of a "throw" property on the iterator. If present, we call that property to get the next { value, done } result. If not present, we should throw the given object.

Currently V8 unconditionally calls the throw method on the iterator.

Thoughts on how to fix this? I could separate the getproperty from the call, but that would mean more assembly :(

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" 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.

Reply via email to