fix spread and super resolution - fixes #42
This commit is contained in:
@@ -4,13 +4,23 @@ class Test extends Foo {
|
||||
super();
|
||||
super.test();
|
||||
foob(super);
|
||||
|
||||
super(...arguments);
|
||||
super("test", ...arguments);
|
||||
|
||||
super.test(...arguments);
|
||||
super.test("test", ...arguments);
|
||||
}
|
||||
|
||||
test() {
|
||||
super();
|
||||
super(...arguments);
|
||||
super("test", ...arguments);
|
||||
}
|
||||
|
||||
static foo() {
|
||||
super();
|
||||
super(...arguments);
|
||||
super("test", ...arguments);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,13 @@ var Test = function (Foo) {
|
||||
Foo.call(this);
|
||||
Foo.prototype.test.call(this);
|
||||
foob(Foo);
|
||||
Foo.call.apply(Foo, [this].concat(Array.prototype.slice.call(arguments)));
|
||||
Foo.call.apply(Foo, [this, "test"].concat(Array.prototype.slice.call(arguments)));
|
||||
Foo.prototype.test.call.apply(Foo.prototype, [this].concat(Array.prototype.slice.call(arguments)));
|
||||
Foo.prototype.test.call.apply(
|
||||
Foo.prototype,
|
||||
[this, "test"].concat(Array.prototype.slice.call(arguments))
|
||||
);
|
||||
}
|
||||
Test.prototype = Object.create(Foo.prototype, {
|
||||
constructor: {
|
||||
@@ -16,9 +23,16 @@ var Test = function (Foo) {
|
||||
Test.__proto__ = Foo;
|
||||
Test.prototype.test = function () {
|
||||
Foo.prototype.test.call(this);
|
||||
Foo.prototype.test.call.apply(Foo.prototype.test, [this].concat(Array.prototype.slice.call(arguments)));
|
||||
Foo.prototype.test.call.apply(
|
||||
Foo.prototype.test,
|
||||
[this, "test"].concat(Array.prototype.slice.call(arguments))
|
||||
);
|
||||
};
|
||||
Test.foo = function () {
|
||||
Foo.foo.call(this);
|
||||
Foo.foo.call.apply(Foo.foo, [this].concat(Array.prototype.slice.call(arguments)));
|
||||
Foo.foo.call.apply(Foo.foo, [this, "test"].concat(Array.prototype.slice.call(arguments)));
|
||||
};
|
||||
return Test;
|
||||
}(Foo);
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
foob.add(foo, bar, ...numbers);
|
||||
foob.test.add(foo, bar, ...numbers);
|
||||
|
||||
@@ -2,3 +2,7 @@ foob.add.apply(foob, [
|
||||
foo,
|
||||
bar
|
||||
].concat(numbers));
|
||||
foob.test.add.apply(foob.test, [
|
||||
foo,
|
||||
bar
|
||||
].concat(numbers));
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
foob.add(...numbers);
|
||||
foob.test.add(...numbers);
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
foob.add.apply(foob, numbers);
|
||||
foob.test.add.apply(foob.test, numbers);
|
||||
|
||||
Reference in New Issue
Block a user