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

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

Issue 1309043004: Revert of Add a separate scope for switch (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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/scopes.h ('k') | test/mjsunit/switch.js » ('j') | 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 // See: http://code.google.com/p/v8/issues/detail?id=4377
6
7 // Switch statements should introduce their own lexical scope
8
9 'use strict';
10
11 switch (1) { case 1: let x = 2; }
12
13 assertThrows(() => x, ReferenceError);
14
15 {
16 let result;
17 let x = 1;
18 switch (x) {
19 case 1:
20 let x = 2;
21 result = x;
22 break;
23 default:
24 result = 0;
25 break;
26 }
27 assertEquals(1, x);
28 assertEquals(2, result);
29 }
30
31 {
32 let result;
33 let x = 1;
34 switch (eval('x')) {
35 case 1:
36 let x = 2;
37 result = x;
38 break;
39 default:
40 result = 0;
41 break;
42 }
43 assertEquals(1, x);
44 assertEquals(2, result);
45 }
OLDNEW
« no previous file with comments | « src/scopes.h ('k') | test/mjsunit/switch.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698