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: --harmony-destructuring --harmony-computed-property-names | 5 // Flags: --harmony-destructuring |
6 // Flags: --harmony-arrow-functions --harmony-rest-parameters | 6 // Flags: --harmony-arrow-functions --harmony-rest-parameters |
7 | 7 |
8 (function TestObjectLiteralPattern() { | 8 (function TestObjectLiteralPattern() { |
9 var { x : x, y : y } = { x : 1, y : 2 }; | 9 var { x : x, y : y } = { x : 1, y : 2 }; |
10 assertEquals(1, x); | 10 assertEquals(1, x); |
11 assertEquals(2, y); | 11 assertEquals(2, y); |
12 | 12 |
13 var {z} = { z : 3 }; | 13 var {z} = { z : 3 }; |
14 assertEquals(3, z); | 14 assertEquals(3, z); |
15 | 15 |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 assertThrows("'use strict'; function f({x}) { let x = 0; }; f({});", SyntaxErr
or); | 917 assertThrows("'use strict'; function f({x}) { let x = 0; }; f({});", SyntaxErr
or); |
918 }()); | 918 }()); |
919 | 919 |
920 | 920 |
921 (function TestForInOfTDZ() { | 921 (function TestForInOfTDZ() { |
922 assertThrows("'use strict'; let x = {}; for (let [x, y] of {x});", ReferenceEr
ror); | 922 assertThrows("'use strict'; let x = {}; for (let [x, y] of {x});", ReferenceEr
ror); |
923 assertThrows("'use strict'; let x = {}; for (let [y, x] of {x});", ReferenceEr
ror); | 923 assertThrows("'use strict'; let x = {}; for (let [y, x] of {x});", ReferenceEr
ror); |
924 assertThrows("'use strict'; let x = {}; for (let [x, y] in {x});", ReferenceEr
ror); | 924 assertThrows("'use strict'; let x = {}; for (let [x, y] in {x});", ReferenceEr
ror); |
925 assertThrows("'use strict'; let x = {}; for (let [y, x] in {x});", ReferenceEr
ror); | 925 assertThrows("'use strict'; let x = {}; for (let [y, x] in {x});", ReferenceEr
ror); |
926 }()); | 926 }()); |
OLD | NEW |