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

Side by Side Diff: test/mjsunit/strong/classes.js

Issue 1019283002: [strong] Check constructor returns (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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
« test/cctest/test-parsing.cc ('K') | « test/cctest/test-parsing.cc ('k') | no next file » | 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: --strong-mode 5 // Flags: --strong-mode
6 // Flags: --harmony-classes --harmony-arrow-functions 6 // Flags: --harmony-classes --harmony-arrow-functions
7 7
8 'use strong'; 8 'use strong';
9 9
10 class C {} 10 class C {}
(...skipping 14 matching lines...) Expand all
25 return "'use strong'; " + 25 return "'use strong'; " +
26 "(class extends Object { constructor() { " + body + " } })"; 26 "(class extends Object { constructor() { " + body + " } })";
27 } 27 }
28 28
29 (function NoMissingSuper() { 29 (function NoMissingSuper() {
30 assertReferenceError(constructor("")); 30 assertReferenceError(constructor(""));
31 assertReferenceError(constructor("1")); 31 assertReferenceError(constructor("1"));
32 })(); 32 })();
33 33
34 (function NoNestedSuper() { 34 (function NoNestedSuper() {
35 assertSyntaxError(constructor("(super())")); 35 assertSyntaxError(constructor("(super());"));
36 assertSyntaxError(constructor("(() => super())(); } })")); 36 assertSyntaxError(constructor("(() => super())();"));
37 assertSyntaxError(constructor("{ super();")); 37 assertSyntaxError(constructor("{ super(); }"));
38 assertSyntaxError(constructor("if (1) super();")); 38 assertSyntaxError(constructor("if (1) super();"));
39 })(); 39 })();
40 40
41 (function NoDuplicateSuper() { 41 (function NoDuplicateSuper() {
42 assertSyntaxError(constructor("super(), super();")); 42 assertSyntaxError(constructor("super(), super();"));
43 assertSyntaxError(constructor("super(); super();")); 43 assertSyntaxError(constructor("super(); super();"));
44 assertSyntaxError(constructor("super(); (super());")); 44 assertSyntaxError(constructor("super(); (super());"));
45 assertSyntaxError(constructor("super(); { super() }")); 45 assertSyntaxError(constructor("super(); { super() }"));
46 assertSyntaxError(constructor("super(); (() => super())();"));
46 })(); 47 })();
48
49 (function NoReturnValue() {
50 assertSyntaxError(constructor("return {};"));
51 assertSyntaxError(constructor("return undefined;"));
52 assertSyntaxError(constructor("{ return {}; }"));
53 assertSyntaxError(constructor("if (1) return {};"));
54 })();
55
56 (function NoReturnBeforeSuper() {
57 assertSyntaxError(constructor("return; super();"));
58 assertSyntaxError(constructor("if (0) return; super();"));
59 assertSyntaxError(constructor("{ return; } super();"));
60 })();
OLDNEW
« test/cctest/test-parsing.cc ('K') | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698