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

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

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

Powered by Google App Engine
This is Rietveld 408576698