// Copyright 2016 the V8 project authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.variter={}iter[Symbol.iterator]=()=>({next:()=>({}),return:()=>{throw666}});function*foo(){for(letxofiter){throw42}}assertThrowsEquals(()=>foo().next(),42);function*bar(){letx;{letgaga=()=>{x};[[x]]=iter;}}assertThrows(()=>bar().next(),TypeError);functionbaz(){letx;{letgaga=()=>{x};letgugu=()=>{gaga};[[x]]=iter;}}assertThrows(baz,TypeError);