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

Unified Diff: test/mjsunit/harmony/classes.js

Issue 923443003: new classes: no longer experimental. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: One more rebase? Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/message/super-constructor-extra-statement.out ('k') | test/mjsunit/harmony/classes-experimental.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/classes.js
diff --git a/test/mjsunit/harmony/classes.js b/test/mjsunit/harmony/classes.js
index 31871bf81451e3d34431392420e5e6dfa666646a..1b19a13193a45e7205ba8e1070015184a8240dc2 100644
--- a/test/mjsunit/harmony/classes.js
+++ b/test/mjsunit/harmony/classes.js
@@ -139,6 +139,7 @@
class C extends B {
constructor() {
+ super();
calls++;
assertEquals(42, super.x);
}
@@ -613,8 +614,8 @@ function assertAccessorDescriptor(object, name) {
(function TestDefaultConstructorNoCrash() {
// Regression test for https://code.google.com/p/v8/issues/detail?id=3661
class C {}
- assertEquals(undefined, C());
- assertEquals(undefined, C(1));
+ assertThrows(function () {C();}, TypeError);
+ assertThrows(function () {C(1);}, TypeError);
assertTrue(new C() instanceof C);
assertTrue(new C(1) instanceof C);
})();
@@ -632,8 +633,8 @@ function assertAccessorDescriptor(object, name) {
assertEquals(1, calls);
calls = 0;
- Derived();
- assertEquals(1, calls);
+ assertThrows(function() { Derived(); }, TypeError);
+ assertEquals(0, calls);
})();
@@ -656,9 +657,7 @@ function assertAccessorDescriptor(object, name) {
var arr = new Array(100);
var obj = {};
- Derived.apply(obj, arr);
- assertEquals(100, args.length);
- assertEquals(obj, self);
+ assertThrows(function() {Derived.apply(obj, arr);}, TypeError);
})();
@@ -783,72 +782,73 @@ function assertAccessorDescriptor(object, name) {
})();
-(function TestSuperCallSyntacticRestriction() {
- assertThrows(function() {
- class C {
+(function TestThisAccessRestriction() {
+ class Base {}
+ (function() {
+ class C extends Base {
constructor() {
var y;
super();
}
}; new C();
- }, TypeError);
+ }());
assertThrows(function() {
- class C {
+ class C extends Base {
constructor() {
super(this.x);
}
}; new C();
- }, TypeError);
+ }, ReferenceError);
assertThrows(function() {
- class C {
+ class C extends Base {
constructor() {
super(this);
}
}; new C();
- }, TypeError);
+ }, ReferenceError);
assertThrows(function() {
- class C {
+ class C extends Base {
constructor() {
super.method();
super(this);
}
}; new C();
- }, TypeError);
+ }, ReferenceError);
assertThrows(function() {
- class C {
+ class C extends Base {
constructor() {
super(super.method());
}
}; new C();
- }, TypeError);
+ }, ReferenceError);
assertThrows(function() {
- class C {
+ class C extends Base {
constructor() {
super(super());
}
}; new C();
- }, TypeError);
+ }, ReferenceError);
assertThrows(function() {
- class C {
+ class C extends Base {
constructor() {
super(1, 2, Object.getPrototypeOf(this));
}
}; new C();
- }, TypeError);
- assertThrows(function() {
- class C {
+ }, ReferenceError);
+ (function() {
+ class C extends Base {
constructor() {
{ super(1, 2); }
}
}; new C();
- }, TypeError);
- assertThrows(function() {
- class C {
+ }());
+ (function() {
+ class C extends Base {
constructor() {
if (1) super();
}
}; new C();
- }, TypeError);
+ }());
class C1 extends Object {
constructor() {
« no previous file with comments | « test/message/super-constructor-extra-statement.out ('k') | test/mjsunit/harmony/classes-experimental.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698