b481afd893
The catch scopes were created with the wrong parent scope. R=littledan@chromium.org BUG=v8:5648 Committed: https://crrev.com/f385268d11d6da9508e481202b39f75f4b56afdd Review-Url: https://codereview.chromium.org/2520883002 Cr-Original-Commit-Position: refs/heads/master@{#41222} Cr-Commit-Position: refs/heads/master@{#41253}
36 lines
628 B
JavaScript
36 lines
628 B
JavaScript
// 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.
|
|
|
|
|
|
var iter = {}
|
|
iter[Symbol.iterator] = () => ({
|
|
next: () => ({}),
|
|
return: () => {throw 666}
|
|
});
|
|
|
|
|
|
function* foo() {
|
|
for (let x of iter) {throw 42}
|
|
}
|
|
assertThrowsEquals(() => foo().next(), 42);
|
|
|
|
|
|
function* bar() {
|
|
let x;
|
|
{ let gaga = () => {x};
|
|
[[x]] = iter;
|
|
}
|
|
}
|
|
assertThrows(() => bar().next(), TypeError);
|
|
|
|
|
|
function baz() {
|
|
let x;
|
|
{ let gaga = () => {x};
|
|
let gugu = () => {gaga};
|
|
[[x]] = iter;
|
|
}
|
|
}
|
|
assertThrows(baz, TypeError);
|