Index: test/mjsunit/harmony/classes.js |
diff --git a/test/mjsunit/harmony/classes.js b/test/mjsunit/harmony/classes.js |
index 8748f629ed1f0f653f1a5dfa49fc86059339224a..1103d7f54ba3550db2ea36d0227d369267f5e1e0 100644 |
--- a/test/mjsunit/harmony/classes.js |
+++ b/test/mjsunit/harmony/classes.js |
@@ -624,6 +624,31 @@ function assertAccessorDescriptor(object, name) { |
})(); |
+(function TestDefaultConstructorArguments() { |
+ var args, self; |
+ class Base { |
+ constructor() { |
Dmitry Lomov (no reviews)
2014/11/11 10:12:50
Add a test with constructor that takes arguments n
|
+ self = this; |
+ args = arguments; |
+ } |
+ } |
+ class Derived extends Base {} |
+ |
+ new Derived; |
+ assertEquals(0, args.length); |
+ |
+ new Derived(0, 1, 2); |
+ assertEquals(3, args.length); |
+ assertTrue(self instanceof Derived); |
+ |
+ var arr = new Array(1e5); |
+ var obj = {}; |
+ Derived.apply(obj, arr); |
+ assertEquals(1e5, args.length); |
+ assertEquals(obj, self); |
+})(); |
+ |
+ |
/* TODO(arv): Implement |
(function TestNameBindingInConstructor() { |
class C { |