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

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

Issue 1318693002: [turbofan] Fix broken dynamic TDZ check for let and const. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 months 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
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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 // Flags: --allow-natives-syntax --turbo-filter=test*
6
7 // Tests that TurboFan emits a dynamic hole-check for the temporal dead zone at
8 // a non-initializing assignments to a {let} variable.
9 function test_hole_check_for_let(a) {
10 'use strict';
11 { switch (a) {
12 case 0: let x;
13 case 1: x = 9;
14 }
15 }
16 }
17 assertDoesNotThrow("test_hole_check_for_let(0)");
18 assertThrows("test_hole_check_for_let(1)", ReferenceError);
19 %OptimizeFunctionOnNextCall(test_hole_check_for_let)
20 assertThrows("test_hole_check_for_let(1)", ReferenceError);
21
22 // Tests that TurboFan emits a dynamic hole-check for the temporal dead zone at
23 // a non-initializing assignments to a {const} variable.
24 function test_hole_check_for_const(a) {
25 'use strict';
26 { switch (a) {
27 case 0: const x = 3;
28 case 1: x = 2;
29 }
30 }
31 }
32 assertThrows("test_hole_check_for_const(0)", TypeError);
33 assertThrows("test_hole_check_for_const(1)", ReferenceError);
34 %OptimizeFunctionOnNextCall(test_hole_check_for_const)
35 assertThrows("test_hole_check_for_const(1)", ReferenceError);
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698