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

Side by Side Diff: test/mjsunit/es6/block-non-strict-errors.js

Issue 1571793002: Reland of Ship ES2015 sloppy-mode function hoisting, let, class (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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-let-contextual-sloppy.js ('k') | test/mjsunit/es6/block-scope-class.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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: --no-harmony-sloppy-let --no-harmony-sloppy-function
6 // Flags: --no-harmony-sloppy
7
5 function CheckError(source) { 8 function CheckError(source) {
6 var exception = null; 9 var exception = null;
7 try { 10 try {
8 eval(source); 11 eval(source);
9 } catch (e) { 12 } catch (e) {
10 exception = e; 13 exception = e;
11 } 14 }
12 assertNotNull(exception); 15 assertNotNull(exception);
13 assertEquals( 16 assertEquals(
14 "Block-scoped declarations (let, const, function, class) not yet supported outside strict mode", 17 "Block-scoped declarations (let, const, function, class) not yet supported outside strict mode",
(...skipping 15 matching lines...) Expand all
30 CheckError("class C extends Array {}"); 33 CheckError("class C extends Array {}");
31 CheckError("(class {});"); 34 CheckError("(class {});");
32 CheckError("(class extends Array {});"); 35 CheckError("(class extends Array {});");
33 CheckError("(class C {});"); 36 CheckError("(class C {});");
34 CheckError("(class C exends Array {});"); 37 CheckError("(class C exends Array {});");
35 38
36 CheckOk("let = 1;"); 39 CheckOk("let = 1;");
37 CheckOk("{ let = 1; }"); 40 CheckOk("{ let = 1; }");
38 CheckOk("function f() { let = 1; }"); 41 CheckOk("function f() { let = 1; }");
39 CheckOk("for (let = 1; let < 1; let++) {}"); 42 CheckOk("for (let = 1; let < 1; let++) {}");
OLDNEW
« no previous file with comments | « test/mjsunit/es6/block-let-contextual-sloppy.js ('k') | test/mjsunit/es6/block-scope-class.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698