Merge branch 'master' into code-generator

Conflicts:
	lib/6to5/transformers/classes.js
	test/fixtures/transformation/source-maps/class/expected.js
	test/fixtures/transformation/source-maps/class/source-mappings.json
This commit is contained in:
Sebastian McKenzie
2014-11-03 13:38:44 +11:00
14 changed files with 110 additions and 39 deletions

View File

@@ -1,5 +1,12 @@
"use strict";
var _slice = Array.prototype.slice;
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var _extends = function (child, parent) {
child.prototype = Object.create(parent.prototype, {
constructor: {
@@ -27,7 +34,17 @@ var Test = function(Foo) {
_extends(Test, Foo);
Object.defineProperties(Test.prototype, {
_classProps(Test, {
foo: {
writable: true,
value: function() {
Foo.foo.call(this);
Foo.foo.call.apply(Foo.foo, [this].concat(_slice.call(arguments)));
Foo.foo.call.apply(Foo.foo, [this, "test"].concat(_slice.call(arguments)));
}
}
}, {
test: {
writable: true,
@@ -39,17 +56,5 @@ var Test = function(Foo) {
}
});
Object.defineProperties(Test, {
foo: {
writable: true,
value: function() {
Foo.foo.call(this);
Foo.foo.call.apply(Foo.foo, [this].concat(_slice.call(arguments)));
Foo.foo.call.apply(Foo.foo, [this, "test"].concat(_slice.call(arguments)));
}
}
});
return Test;
}(Foo);

View File

@@ -1,5 +1,10 @@
"use strict";
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var _extends = function (child, parent) {
child.prototype = Object.create(parent.prototype, {
constructor: {
@@ -13,7 +18,6 @@ var _extends = function (child, parent) {
child.__proto__ = parent;
};
var Test = function(Foo) {
var Test = function Test() {
Foo.prototype.test.whatever();
@@ -22,7 +26,7 @@ var Test = function(Foo) {
_extends(Test, Foo);
Object.defineProperties(Test, {
_classProps(Test, {
test: {
writable: true,
@@ -30,7 +34,7 @@ var Test = function(Foo) {
return Foo.wow.call(this);
}
}
});
}, null);
return Test;
}(Foo);

View File

@@ -1,9 +1,14 @@
"use strict";
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var Test = function() {
var Test = function Test() {};
Object.defineProperties(Test.prototype, {
_classProps(Test, null, {
test: {
get: function() {
return 5 + 5;
@@ -16,4 +21,4 @@ var Test = function() {
});
return Test;
}();
}();

View File

@@ -1,9 +1,14 @@
"use strict";
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var Test = function() {
var Test = function Test() {};
Object.defineProperties(Test.prototype, {
_classProps(Test, null, {
test: {
get: function() {
return 5 + 5;
@@ -12,4 +17,4 @@ var Test = function() {
});
return Test;
}();
}();

View File

@@ -1,9 +1,14 @@
"use strict";
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var Test = function() {
var Test = function Test() {};
Object.defineProperties(Test.prototype, {
_classProps(Test, null, {
test: {
writable: true,
@@ -14,4 +19,4 @@ var Test = function() {
});
return Test;
}();
}();

View File

@@ -1,9 +1,14 @@
"use strict";
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var Test = function() {
var Test = function Test() {};
Object.defineProperties(Test.prototype, {
_classProps(Test, null, {
test: {
set: function(val) {
this._test = val;
@@ -12,4 +17,4 @@ var Test = function() {
});
return Test;
}();
}();

View File

@@ -1,9 +1,14 @@
"use strict";
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var A = function() {
var A = function A() {};
Object.defineProperties(A, {
_classProps(A, {
a: {
writable: true,
value: function() {}
@@ -13,7 +18,7 @@ var A = function() {
get: function() {},
set: function(b) {}
}
});
}, null);
return A;
}();
}();