61b5ba7ecf
_SyncIterable::iterator clones unerlying sync* closure to create a new Iterator using _Closure._clone(). _Closure._clone() was cloning only 1 level of context, relying on a particular context structure. In bytecode, contexts are allocated in a different way, so sync* functions could have more then 1 level of contexts. In such case, parent contexts were not cloned in _Closure._clone() and were shared between Iterator instances. This CL adds deep cloning of contexts into _Closure._clone() native method in order to handle arbitrary number of levels of contexts in a closure. Fixes language_2/syncstar_yield_test test in bytecode mode. Change-Id: Ic5ced4c32fc2e21726db76608cd3a7db7e553472 Reviewed-on: https://dart-review.googlesource.com/70600 Reviewed-by: Régis Crelier <regis@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>