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

Side by Side Diff: test/mjsunit/es6/block-non-strict-errors.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-let-semantics-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
(Empty)
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
3 // found in the LICENSE file.
4
5 // Flags: --no-harmony-sloppy-let --no-harmony-sloppy-function
6 // Flags: --no-harmony-sloppy
7
8 function CheckError(source) {
9 var exception = null;
10 try {
11 eval(source);
12 } catch (e) {
13 exception = e;
14 }
15 assertNotNull(exception);
16 assertEquals(
17 "Block-scoped declarations (let, const, function, class) not yet supported outside strict mode",
18 exception.message);
19 }
20
21
22 function CheckOk(source) {
23 eval(source);
24 }
25
26 CheckError("let x = 1;");
27 CheckError("{ let x = 1; }");
28 CheckError("function f() { let x = 1; }");
29 CheckError("for (let x = 1; x < 1; x++) {}");
30 CheckError("for (let x of []) {}");
31 CheckError("for (let x in []) {}");
32 CheckError("class C {}");
33 CheckError("class C extends Array {}");
34 CheckError("(class {});");
35 CheckError("(class extends Array {});");
36 CheckError("(class C {});");
37 CheckError("(class C exends Array {});");
38
39 CheckOk("let = 1;");
40 CheckOk("{ let = 1; }");
41 CheckOk("function f() { let = 1; }");
42 CheckOk("for (let = 1; let < 1; let++) {}");
OLDNEW
« no previous file with comments | « test/mjsunit/es6/block-let-semantics-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