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,5 +1,5 @@
var Test = function() {
function Test() {}
var Test = function Test() {};
return Test;
}();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGliL2Jhci9iYXIuanMiLCJzb3VyY2VzIjpbInNyYy9iYXIvYmFyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJJQUFNLENBQUMsQ0FBQyxDQUFDO1dBQUgsQ0FBQyxDQUFDLENBQUM7U0FBSCxDQUFDLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImNsYXNzIFRlc3Qge1xuXG59Il19
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGliL2Jhci9iYXIuanMiLCJzb3VyY2VzIjpbInNyYy9iYXIvYmFyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJJQUFNLENBQUMsQ0FBQyxDQUFDO01BQUgsQ0FBQyxDQUFDLENBQUMsYUFBSCxDQUFDLENBQUMsQ0FBQztTQUFILENBQUMsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiY2xhc3MgVGVzdCB7XG5cbn0iXX0=

View File

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

View File

@@ -1 +1 @@
{"version":3,"file":"lib/bar/bar.js","sources":["src/bar/bar.js"],"names":[],"mappings":"IAAM,CAAC,CAAC,CAAC;WAAH,CAAC,CAAC,CAAC;SAAH,CAAC,CAAC,CAAC","sourcesContent":["class Test {\n\n}"]}
{"version":3,"file":"lib/bar/bar.js","sources":["src/bar/bar.js"],"names":[],"mappings":"IAAM,CAAC,CAAC,CAAC;MAAH,CAAC,CAAC,CAAC,aAAH,CAAC,CAAC,CAAC;SAAH,CAAC,CAAC,CAAC","sourcesContent":["class Test {\n\n}"]}

View File

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

View File

@@ -1,9 +1,9 @@
var Test = function() {
function Test() {}
var Test = function Test() {};
return Test;
}();
arr.map(function(x) {
return x * MULTIPLIER;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyIsInNjcmlwdDIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IklBQU0sQ0FBQyxDQUFDLENBQUM7V0FBSCxDQUFDLENBQUMsQ0FBQztTQUFILENBQUMsQ0FBQyxDQUFDOzs7QUNBVCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLFVBQUM7U0FBSyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7Q0FBQyxDQUFDIiwiZmlsZSI6InNjcmlwdDMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJjbGFzcyBUZXN0IHtcblxufSIsImFyci5tYXAoeCA9PiB4ICogTVVMVElQTElFUik7Il19
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyIsInNjcmlwdDIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IklBQU0sQ0FBQyxDQUFDLENBQUM7TUFBSCxDQUFDLENBQUMsQ0FBQyxhQUFILENBQUMsQ0FBQyxDQUFDO1NBQUgsQ0FBQyxDQUFDLENBQUM7OztBQ0FULENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsVUFBQztTQUFLLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztDQUFDLENBQUMiLCJmaWxlIjoic2NyaXB0My5qcyIsInNvdXJjZXNDb250ZW50IjpbImNsYXNzIFRlc3Qge1xuXG59IiwiYXJyLm1hcCh4ID0+IHggKiBNVUxUSVBMSUVSKTsiXX0=

View File

@@ -1,5 +1,5 @@
var Test = function() {
function Test() {}
var Test = function Test() {};
return Test;
}();
arr.map(function(x) {

View File

@@ -1 +1 @@
{"version":3,"sources":["script.js","script2.js"],"names":[],"mappings":"IAAM,CAAC,CAAC,CAAC;WAAH,CAAC,CAAC,CAAC;SAAH,CAAC,CAAC,CAAC;;;ACAT,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAC;SAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAC,CAAC","file":"script3.js","sourcesContent":["class Test {\n\n}","arr.map(x => x * MULTIPLIER);"]}
{"version":3,"sources":["script.js","script2.js"],"names":[],"mappings":"IAAM,CAAC,CAAC,CAAC;MAAH,CAAC,CAAC,CAAC,aAAH,CAAC,CAAC,CAAC;SAAH,CAAC,CAAC,CAAC;;;ACAT,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAC;SAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAC,CAAC","file":"script3.js","sourcesContent":["class Test {\n\n}","arr.map(x => x * MULTIPLIER);"]}

View File

@@ -1,5 +1,5 @@
var Test = function() {
function Test() {}
var Test = function Test() {};
return Test;
}();
arr.map(function(x) {

View File

@@ -1,6 +1,6 @@
var Test = function () {
function Test() {
var Test = function Test() {
arr.map(x => x * x);
}
};
return Test;
}();

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

View File

@@ -8,15 +8,13 @@ exports.default = foo;
exports.default = function () {}
exports.default = function () {
function Anonymous() {
}
return Anonymous;
var _class = function() {};
return _class;
}();
exports.default = function foo () {}
exports.default = function () {
function foo() {
}
var foo = function foo() {};
return foo;
}();

View File

@@ -25,8 +25,7 @@ var foo8;
function foo7 () {}
foo8 = function () {
function foo8() {
}
var foo8 = function foo8() {};
return foo8;
}();
exports.foo8 = foo8;

View File

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