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

Side by Side Diff: test/mjsunit/harmony/destructuring.js

Issue 1218543003: [es6] Ensure that for-in/of loops have a proper TDZ for their boundnames (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 5 years, 5 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
« no previous file with comments | « test/mjsunit/es6/regress/regress-2506.js ('k') | test/mjsunit/strong/declaration-after-use.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }());
OLDNEW
« no previous file with comments | « test/mjsunit/es6/regress/regress-2506.js ('k') | test/mjsunit/strong/declaration-after-use.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698