fix spread and super resolution - fixes #42

This commit is contained in:
Sebastian McKenzie
2014-10-11 10:44:51 +11:00
parent 603ae290cd
commit 3fb17b00a6
8 changed files with 44 additions and 11 deletions

View File

@@ -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);
}
}

View File

@@ -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);