fix static member expression calls, make classes more spec-compliant

This commit is contained in:
Sebastian McKenzie
2014-10-12 13:39:10 +11:00
parent 141ea98b89
commit bb697c6436
34 changed files with 158 additions and 128 deletions

View File

@@ -1,57 +1,57 @@
var Test = function(Foo) {
function Test() {
woops.super.test();
Foo.call(this);
var Test = function Test() {
woops.super.test();
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: {
value: Test,
enumerable: false,
writable: true,
configurable: true
}
});
Test.__proto__ = Foo;
Object.defineProperties(Test.prototype, {
test: {
writeable: true,
value: function() {
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.test, [this].concat(Array.prototype.slice.call(arguments)));
Foo.prototype.test.call.apply(
Foo.prototype,
[this, "test"].concat(Array.prototype.slice.call(arguments))
Foo.prototype.test,
[this, "test"].concat(Array.prototype.slice.call(arguments))
);
}
}
});
Test.prototype = Object.create(Foo.prototype, {
constructor: {
value: Test,
enumerable: false,
writable: true,
configurable: true
}
});
Object.defineProperties(Test, {
foo: {
writeable: true,
Test.__proto__ = Foo;
value: 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)));
}
}
});
Object.defineProperties(Test.prototype, {
test: {
writeable: true,
value: 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))
);
}
}
});
Object.defineProperties(Test, {
foo: {
writeable: true,
value: 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;
return Test;
}(Foo);

View File

@@ -1,18 +1,18 @@
var Test = function(Foo) {
function Test() {
Foo.prototype.test;
Foo.prototype.test.whatever;
var Test = function Test() {
Foo.prototype.test;
Foo.prototype.test.whatever;
};
Test.prototype = Object.create(Foo.prototype, {
constructor: {
value: Test,
enumerable: false,
writable: true,
configurable: true
}
});
Test.prototype = Object.create(Foo.prototype, {
constructor: {
value: Test,
enumerable: false,
writable: true,
configurable: true
}
});
Test.__proto__ = Foo;
return Test;
Test.__proto__ = Foo;
return Test;
}(Foo);

View File

@@ -3,4 +3,8 @@ class Test extends Foo {
super.test.whatever();
super.test();
}
static test() {
return super.wow();
}
}

View File

@@ -1,16 +1,25 @@
var Test = function(Foo) {
function Test() {
Foo.prototype.test.whatever();
Foo.prototype.test.call(this);
var Test = function Test() {
Foo.prototype.test.whatever();
Foo.prototype.test.call(this);
};
Test.prototype = Object.create(Foo.prototype, {
constructor: {
value: Test,
enumerable: false,
writable: true,
configurable: true
}
Test.prototype = Object.create(Foo.prototype, {
constructor: {
value: Test,
enumerable: false,
writable: true,
configurable: true
}
});
Test.__proto__ = Foo;
return Test;
});
Test.__proto__ = Foo;
Object.defineProperties(Test, {
test: {
writeable: true,
value: function() {
return Foo.wow.call(this);
}
}
});
return Test;
}(Foo);

View File

@@ -1,14 +1,14 @@
var Test = function () {
function Test() {
var Test = function Test() {
this.state = "test";
}
};
return Test;
}();
var Foo = function(Bar) {
function Foo() {
var Foo = function Foo() {
this.state = "test";
}
};
Foo.prototype = Object.create(Bar.prototype, {
constructor: {

View File

@@ -1,6 +1,5 @@
var Test = function () {
function Test() {
}
var Test = function Test() { };
Object.defineProperties(Test.prototype, {
test: {
get: function () {

View File

@@ -1,6 +1,5 @@
var Test = function () {
function Test() {
}
var Test = function Test() { };
Object.defineProperties(Test.prototype, {
test: {
get: function () {

View File

@@ -1,6 +1,5 @@
var Test = function () {
function Test() {
}
var Test = function Test() { };
Object.defineProperties(Test.prototype, {
test: {
writeable: true,

View File

@@ -1,6 +1,5 @@
var Test = function () {
function Test() {
}
var Test = function Test() { };
Object.defineProperties(Test.prototype, {
test: {
set: function (val) {

View File

@@ -1,5 +1,4 @@
var Test = function () {
function Test() {
}
var Test = function Test() { };
return Test;
}();

View File

@@ -4,4 +4,8 @@ var BaseView = class BaseView {
}
}
module.exports = BaseView;
var BaseView = class {
constructor() {
this.autoRender = true;
}
}

View File

@@ -1,9 +1,14 @@
var BaseView = function () {
function BaseView() {
var BaseView = function BaseView() {
this.autoRender = true;
}
};
return BaseView;
}();
module.exports = BaseView;
var BaseView = function () {
var _class = function () {
this.autoRender = true;
};
return _class;
}();

View File

@@ -1,5 +1,5 @@
var A = function() {
function A() {}
var A = function A() {};
Object.defineProperties(A, {
a: {

View File

@@ -1,7 +1,7 @@
var BaseController = function (Chaplin) {
function BaseController() {
var BaseController = function BaseController() {
Chaplin.Controller.apply(this, arguments);
}
};
BaseController.prototype = Object.create(Chaplin.Controller.prototype, {
constructor: {
value: BaseController,
@@ -15,9 +15,9 @@ var BaseController = function (Chaplin) {
}(Chaplin);
var BaseController2 = function (Chaplin) {
function BaseController2() {
var BaseController2 = function BaseController2() {
Chaplin.Controller.Another.apply(this, arguments);
}
};
BaseController2.prototype = Object.create(Chaplin.Controller.Another.prototype, {
constructor: {
value: BaseController2,

View File

@@ -1,7 +1,7 @@
var Q = function(_ref) {
function Q() {
var Q = function Q() {
_ref.apply(this, arguments);
}
};
Q.prototype = Object.create(_ref.prototype, {
constructor: {

View File

@@ -1,7 +1,7 @@
var Test = function (Foo) {
function Test() {
var Test = function Test() {
Foo.apply(this, arguments);
}
};
Test.prototype = Object.create(Foo.prototype, {
constructor: {
value: Test,

View File

@@ -1,6 +1,6 @@
var Test = function () {
function Test() {
var Test = function Test() {
Function.prototype.hasOwnProperty.call(this, "test");
}
};
return Test;
}();