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

Side by Side Diff: test/mjsunit/harmony/block-scope-class.js

Issue 1282093002: Split function block scoping into a separate flag (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 4 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
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 // Test for conflicting variable bindings. 5 // Test for conflicting variable bindings.
6 6
7 // Flags: --harmony-sloppy 7 // Flags: --harmony-sloppy --harmony-sloppy-function
8 8
9 function AssertEqualsStrictAndSloppy(value, code) { 9 function AssertEqualsStrictAndSloppy(value, code) {
10 assertEquals(value, eval("(function() {" + code + "})()")); 10 assertEquals(value, eval("(function() {" + code + "})()"));
11 assertEquals(value, eval("(function() { 'use strict'; " + code + "})()")); 11 assertEquals(value, eval("(function() { 'use strict'; " + code + "})()"));
12 assertEquals(value, eval("(function() { var x = 0; {" + code + "} })()")); 12 assertEquals(value, eval("(function() { var x = 0; {" + code + "} })()"));
13 assertEquals(value, eval("(function() { 'use strict'; var x = 0; {" 13 assertEquals(value, eval("(function() { 'use strict'; var x = 0; {"
14 + code + "} })()")); 14 + code + "} })()"));
15 } 15 }
16 16
17 function AssertThrowsStrictAndSloppy(code, error) { 17 function AssertThrowsStrictAndSloppy(code, error) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 AssertThrowsStrictAndSloppy("class x { }; for (var x = 0; false;) { };", 50 AssertThrowsStrictAndSloppy("class x { }; for (var x = 0; false;) { };",
51 SyntaxError); 51 SyntaxError);
52 AssertThrowsStrictAndSloppy("for (var x = 0; false;) { }; class x { };", 52 AssertThrowsStrictAndSloppy("for (var x = 0; false;) { }; class x { };",
53 SyntaxError); 53 SyntaxError);
54 })(); 54 })();
55 55
56 (function TestClassMutableBinding() { 56 (function TestClassMutableBinding() {
57 AssertEqualsStrictAndSloppy( 57 AssertEqualsStrictAndSloppy(
58 "x3", "class x { }; var y = x.name; x = 3; return y + x;") 58 "x3", "class x { }; var y = x.name; x = 3; return y + x;")
59 })(); 59 })();
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/block-let-semantics-sloppy.js ('k') | test/mjsunit/harmony/block-scoping-sloppy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698