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 --harmony-computed-property-names |
6 // Flags: --harmony-arrow-functions | 6 // Flags: --harmony-arrow-functions |
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); |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 assertThrows("'use strict';function f({x,x}){}", SyntaxError); | 721 assertThrows("'use strict';function f({x,x}){}", SyntaxError); |
722 assertThrows("'use strict';function f(x, {x}){}", SyntaxError); | 722 assertThrows("'use strict';function f(x, {x}){}", SyntaxError); |
723 assertThrows("'use strict';var f = (x,x) => {};", SyntaxError); | 723 assertThrows("'use strict';var f = (x,x) => {};", SyntaxError); |
724 assertThrows("'use strict';var f = ({x,x}) => {};", SyntaxError); | 724 assertThrows("'use strict';var f = ({x,x}) => {};", SyntaxError); |
725 assertThrows("'use strict';var f = (x, {x}) => {};", SyntaxError); | 725 assertThrows("'use strict';var f = (x, {x}) => {};", SyntaxError); |
726 | 726 |
727 function ok(x) { var x; }; ok(); | 727 function ok(x) { var x; }; ok(); |
728 assertThrows("function f({x}) { var x; }; f({});", SyntaxError); | 728 assertThrows("function f({x}) { var x; }; f({});", SyntaxError); |
729 assertThrows("'use strict'; function f({x}) { let x = 0; }; f({});", SyntaxErr
or); | 729 assertThrows("'use strict'; function f({x}) { let x = 0; }; f({});", SyntaxErr
or); |
730 }()); | 730 }()); |
| 731 |
| 732 |
| 733 (function TestForInOfTDZ() { |
| 734 assertThrows("'use strict'; let x = {}; for (let [x, y] of {x});", ReferenceEr
ror); |
| 735 assertThrows("'use strict'; let x = {}; for (let [y, x] of {x});", ReferenceEr
ror); |
| 736 assertThrows("'use strict'; let x = {}; for (let [x, y] in {x});", ReferenceEr
ror); |
| 737 assertThrows("'use strict'; let x = {}; for (let [y, x] in {x});", ReferenceEr
ror); |
| 738 }()); |
OLD | NEW |