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

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

Issue 1312613003: Ensure hole checks take place in switch statement scopes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Changes based on review 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
« test/mjsunit/mjsunit.status ('K') | « test/mjsunit/mjsunit.status ('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 // See: http://code.google.com/p/v8/issues/detail?id=3926
6
7 // Switch statements should disable let hole checking
adamk 2015/08/25 19:13:33 I think you mean should disable "hole check elimin
Dan Ehrenberg 2015/08/25 20:54:45 Done
8
9 'use strict';
10
11 function f(x) {
12 var z;
13 switch (x) {
14 case 1:
15 let y = 1;
16 case 2:
17 y = 2;
18 case 3:
19 z = y;
20 }
21 return z;
22 }
23 assertEquals(2, f(1));
24 assertThrows(function() {f(2)}, ReferenceError);
25 assertThrows(function() {f(3)}, ReferenceError);
26
27 assertThrows(function() {
28 switch (1) {
29 case 0:
30 let x = 2;
31 case 1:
32 { // this block, plus the let below, adds another lexical scope, this one li near
adamk 2015/08/25 19:13:33 Nit: 80 chars
Dan Ehrenberg 2015/08/25 20:54:45 Done
33 let y = 3;
34 x;
35 }
36 }
37 }, ReferenceError);
OLDNEW
« test/mjsunit/mjsunit.status ('K') | « test/mjsunit/mjsunit.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698