OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --no-legacy-const --harmony-sloppy --harmony-sloppy-let | 5 // Flags: --no-legacy-const --harmony-sloppy --harmony-sloppy-let |
6 // Flags: --harmony-sloppy-function --harmony-destructuring-bind | 6 // Flags: --harmony-sloppy-function |
7 | 7 |
8 // Test Annex B 3.3 semantics for functions declared in blocks in sloppy mode. | 8 // Test Annex B 3.3 semantics for functions declared in blocks in sloppy mode. |
9 // http://www.ecma-international.org/ecma-262/6.0/#sec-block-level-function-decl
arations-web-legacy-compatibility-semantics | 9 // http://www.ecma-international.org/ecma-262/6.0/#sec-block-level-function-decl
arations-web-legacy-compatibility-semantics |
10 | 10 |
11 (function overridingLocalFunction() { | 11 (function overridingLocalFunction() { |
12 var x = []; | 12 var x = []; |
13 assertEquals('function', typeof f); | 13 assertEquals('function', typeof f); |
14 function f() { | 14 function f() { |
15 x.push(1); | 15 x.push(1); |
16 } | 16 } |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 throws = false; | 292 throws = false; |
293 try { | 293 try { |
294 eval('{ function hoistWhenFrozen() {} }'); | 294 eval('{ function hoistWhenFrozen() {} }'); |
295 } catch (e) { | 295 } catch (e) { |
296 throws = true; | 296 throws = true; |
297 } | 297 } |
298 assertFalse(this.hasOwnProperty("hoistWhenFrozen")); | 298 assertFalse(this.hasOwnProperty("hoistWhenFrozen")); |
299 assertThrows(() => hoistWhenFrozen, ReferenceError); | 299 assertThrows(() => hoistWhenFrozen, ReferenceError); |
300 // Should be assertFalse BUG(v8:4452) | 300 // Should be assertFalse BUG(v8:4452) |
301 assertTrue(throws); | 301 assertTrue(throws); |
OLD | NEW |