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

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

Issue 729323003: Classes: Expand test to cover strict runtime behavior (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | 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 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: --harmony-classes 5 // Flags: --harmony-classes
6 6
7 (function TestBasics() { 7 (function TestBasics() {
8 var C = class C {} 8 var C = class C {}
9 assertEquals(typeof C, 'function'); 9 assertEquals(typeof C, 'function');
10 assertEquals(C.__proto__, Function.prototype); 10 assertEquals(C.__proto__, Function.prototype);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 (function TestStrictMode() { 152 (function TestStrictMode() {
153 class C {} 153 class C {}
154 154
155 with ({a: 1}) { 155 with ({a: 1}) {
156 assertEquals(1, a); 156 assertEquals(1, a);
157 } 157 }
158 158
159 assertThrows('class C extends function B() { with ({}); return B; }() {}', 159 assertThrows('class C extends function B() { with ({}); return B; }() {}',
160 SyntaxError); 160 SyntaxError);
161 161
162 var D = class extends function() {
163 arguments.caller;
164 } {};
165 assertThrows(function() {
166 Object.getPrototypeOf(D).arguments;
167 }, TypeError);
168 assertThrows(function() {
169 new D;
170 }, TypeError);
162 })(); 171 })();
163 172
164 173
165 (function TestToString() { 174 (function TestToString() {
166 class C {} 175 class C {}
167 assertEquals('class C {}', C.toString()); 176 assertEquals('class C {}', C.toString());
168 177
169 class D { constructor() { 42; } } 178 class D { constructor() { 42; } }
170 assertEquals('class D { constructor() { 42; } }', D.toString()); 179 assertEquals('class D { constructor() { 42; } }', D.toString());
171 180
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 }, ReferenceError); 770 }, ReferenceError);
762 771
763 assertThrows(function() { 772 assertThrows(function() {
764 (class x extends x {}); 773 (class x extends x {});
765 }, ReferenceError); 774 }, ReferenceError);
766 775
767 assertThrows(function() { 776 assertThrows(function() {
768 var x = (class x extends x {}); 777 var x = (class x extends x {});
769 }, ReferenceError); 778 }, ReferenceError);
770 })(); 779 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698