| Index: test/mjsunit/regress/regress-3926.js
|
| diff --git a/test/mjsunit/regress/regress-3926.js b/test/mjsunit/regress/regress-3926.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3ee03d7a6fa09b0c607145a89d436f1572bc37eb
|
| --- /dev/null
|
| +++ b/test/mjsunit/regress/regress-3926.js
|
| @@ -0,0 +1,37 @@
|
| +// Copyright 2015 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.
|
| +
|
| +// See: http://code.google.com/p/v8/issues/detail?id=3926
|
| +
|
| +// Switch statements should disable hole check elimination
|
| +
|
| +'use strict';
|
| +
|
| +function f(x) {
|
| + var z;
|
| + switch (x) {
|
| + case 1:
|
| + let y = 1;
|
| + case 2:
|
| + y = 2;
|
| + case 3:
|
| + z = y;
|
| + }
|
| + return z;
|
| +}
|
| +assertEquals(2, f(1));
|
| +assertThrows(function() {f(2)}, ReferenceError);
|
| +assertThrows(function() {f(3)}, ReferenceError);
|
| +
|
| +assertThrows(function() {
|
| + switch (1) {
|
| + case 0:
|
| + let x = 2;
|
| + case 1:
|
| + { // this block, plus the let below, adds another linear lexical scope
|
| + let y = 3;
|
| + x;
|
| + }
|
| + }
|
| +}, ReferenceError);
|
|
|