Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: test/mjsunit/regress/regress-5648.js

Issue 2520883002: [parser] Fix scopes in rewriting of for-of and destructuring assignments. (Closed)
Patch Set: Remove debug print from test. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5
6 var iter = {}
7 iter[Symbol.iterator] = () => ({
8 next: () => ({}),
9 return: () => {throw 666}
10 });
11
12
13 function* foo() {
14 for (let x of iter) {throw 42}
15 }
16 assertThrowsEquals(() => foo().next(), 42);
17
18
19 function* bar() {
20 let x;
21 { let gaga = () => {x};
22 [[x]] = iter;
23 }
24 }
25 assertThrows(() => bar().next(), TypeError);
26
27
28 function baz() {
29 let x;
30 { let gaga = () => {x};
31 let gugu = () => {gaga};
32 [[x]] = iter;
33 }
34 }
35 assertThrows(baz, TypeError);
OLDNEW
« src/parsing/parser.cc ('K') | « test/cctest/interpreter/bytecode_expectations/Generators.golden ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698