update tests to latest experimental changes

This commit is contained in:
Sebastian McKenzie
2015-03-25 20:20:51 +11:00
parent aa1333123c
commit 5390715705
23 changed files with 151 additions and 170 deletions

View File

@@ -5,12 +5,11 @@ var Foo = (function () {
babelHelpers.classCallCheck(this, Foo);
}
babelHelpers.createClass(Foo, {
foo: {
value: babelHelpers.asyncToGenerator(function* () {
var wat = yield bar();
})
}
});
babelHelpers.createClass(Foo, [{
key: "foo",
value: babelHelpers.asyncToGenerator(function* () {
var wat = yield bar();
})
}]);
return Foo;
})();
})();

View File

@@ -2,22 +2,16 @@
var _bluebird = require("bluebird");
var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
var Foo = (function () {
function Foo() {
_classCallCheck(this, Foo);
babelHelpers.classCallCheck(this, Foo);
}
_createClass(Foo, {
foo: {
value: _bluebird.coroutine(function* () {
var wat = yield bar();
})
}
});
babelHelpers.createClass(Foo, [{
key: "foo",
value: _bluebird.coroutine(function* () {
var wat = yield bar();
})
}]);
return Foo;
})();
})();

View File

@@ -0,0 +1,3 @@
{
"externalHelpers": true
}

View File

@@ -1,8 +1,8 @@
class Test {
get test() {
return 5 + 5;
return 5 + 5;
}
set test(val) {
this._test = val;
this._test = val;
}
}

View File

@@ -5,15 +5,14 @@ var Test = (function () {
babelHelpers.classCallCheck(this, Test);
}
babelHelpers.createClass(Test, {
test: {
get: function () {
return 5 + 5;
},
set: function (val) {
this._test = val;
}
babelHelpers.createClass(Test, [{
key: "test",
get: function () {
return 5 + 5;
},
set: function (val) {
this._test = val;
}
});
}]);
return Test;
})();
})();

View File

@@ -5,12 +5,11 @@ var Test = (function () {
babelHelpers.classCallCheck(this, Test);
}
babelHelpers.createClass(Test, {
test: {
get: function () {
return 5 + 5;
}
babelHelpers.createClass(Test, [{
key: "test",
get: function () {
return 5 + 5;
}
});
}]);
return Test;
})();
})();

View File

@@ -5,12 +5,11 @@ var Test = (function () {
babelHelpers.classCallCheck(this, Test);
}
babelHelpers.createClass(Test, {
test: {
value: function test() {
return 5 + 5;
}
babelHelpers.createClass(Test, [{
key: "test",
value: function test() {
return 5 + 5;
}
});
}]);
return Test;
})();
})();

View File

@@ -5,12 +5,11 @@ var Test = (function () {
babelHelpers.classCallCheck(this, Test);
}
babelHelpers.createClass(Test, {
test: {
set: function (val) {
this._test = val;
}
babelHelpers.createClass(Test, [{
key: "test",
set: function (val) {
this._test = val;
}
});
}]);
return Test;
})();
})();

View File

@@ -21,12 +21,11 @@ var BaseView = (function () {
babelHelpers.classCallCheck(this, _class2);
};
babelHelpers.createClass(_class2, {
foo: {
value: function foo() {
this.autoRender = true;
}
babelHelpers.createClass(_class2, [{
key: "foo",
value: function foo() {
this.autoRender = true;
}
});
}]);
return _class2;
})();

View File

@@ -8,13 +8,12 @@ class TestMethodOnly extends (class { method() {} }) {
}
class TestConstructorAndMethod extends (class {
constructor() {}
method() {}
constructor() {}
method() {}
}) {
}
class TestMultipleMethods extends (class {
m1() {}
m2() {}
}) {
}
m1() {}
m2() {}
}) {}

View File

@@ -1,114 +1,111 @@
"use strict";
var TestEmpty = (function (_ref) {
function TestEmpty() {
babelHelpers.classCallCheck(this, TestEmpty);
function TestEmpty() {
babelHelpers.classCallCheck(this, TestEmpty);
if (_ref != null) {
_ref.apply(this, arguments);
}
if (_ref != null) {
_ref.apply(this, arguments);
}
}
babelHelpers.inherits(TestEmpty, _ref);
return TestEmpty;
babelHelpers.inherits(TestEmpty, _ref);
return TestEmpty;
})((function () {
var _class = function () {
babelHelpers.classCallCheck(this, _class);
};
var _class = function () {
babelHelpers.classCallCheck(this, _class);
};
return _class;
return _class;
})());
var TestConstructorOnly = (function (_ref2) {
function TestConstructorOnly() {
babelHelpers.classCallCheck(this, TestConstructorOnly);
function TestConstructorOnly() {
babelHelpers.classCallCheck(this, TestConstructorOnly);
if (_ref2 != null) {
_ref2.apply(this, arguments);
}
if (_ref2 != null) {
_ref2.apply(this, arguments);
}
}
babelHelpers.inherits(TestConstructorOnly, _ref2);
return TestConstructorOnly;
babelHelpers.inherits(TestConstructorOnly, _ref2);
return TestConstructorOnly;
})((function () {
var _class2 = function () {
babelHelpers.classCallCheck(this, _class2);
};
var _class2 = function () {
babelHelpers.classCallCheck(this, _class2);
};
return _class2;
return _class2;
})());
var TestMethodOnly = (function (_ref3) {
function TestMethodOnly() {
babelHelpers.classCallCheck(this, TestMethodOnly);
function TestMethodOnly() {
babelHelpers.classCallCheck(this, TestMethodOnly);
if (_ref3 != null) {
_ref3.apply(this, arguments);
}
if (_ref3 != null) {
_ref3.apply(this, arguments);
}
}
babelHelpers.inherits(TestMethodOnly, _ref3);
return TestMethodOnly;
babelHelpers.inherits(TestMethodOnly, _ref3);
return TestMethodOnly;
})((function () {
var _class3 = function () {
babelHelpers.classCallCheck(this, _class3);
};
var _class3 = function () {
babelHelpers.classCallCheck(this, _class3);
};
babelHelpers.createClass(_class3, {
method: {
value: function method() {}
}
});
return _class3;
babelHelpers.createClass(_class3, [{
key: "method",
value: function method() {}
}]);
return _class3;
})());
var TestConstructorAndMethod = (function (_ref4) {
function TestConstructorAndMethod() {
babelHelpers.classCallCheck(this, TestConstructorAndMethod);
function TestConstructorAndMethod() {
babelHelpers.classCallCheck(this, TestConstructorAndMethod);
if (_ref4 != null) {
_ref4.apply(this, arguments);
}
if (_ref4 != null) {
_ref4.apply(this, arguments);
}
}
babelHelpers.inherits(TestConstructorAndMethod, _ref4);
return TestConstructorAndMethod;
babelHelpers.inherits(TestConstructorAndMethod, _ref4);
return TestConstructorAndMethod;
})((function () {
var _class4 = function () {
babelHelpers.classCallCheck(this, _class4);
};
var _class4 = function () {
babelHelpers.classCallCheck(this, _class4);
};
babelHelpers.createClass(_class4, {
method: {
value: function method() {}
}
});
return _class4;
babelHelpers.createClass(_class4, [{
key: "method",
value: function method() {}
}]);
return _class4;
})());
var TestMultipleMethods = (function (_ref5) {
function TestMultipleMethods() {
babelHelpers.classCallCheck(this, TestMultipleMethods);
function TestMultipleMethods() {
babelHelpers.classCallCheck(this, TestMultipleMethods);
if (_ref5 != null) {
_ref5.apply(this, arguments);
}
if (_ref5 != null) {
_ref5.apply(this, arguments);
}
}
babelHelpers.inherits(TestMultipleMethods, _ref5);
return TestMultipleMethods;
babelHelpers.inherits(TestMultipleMethods, _ref5);
return TestMultipleMethods;
})((function () {
var _class5 = function () {
babelHelpers.classCallCheck(this, _class5);
};
var _class5 = function () {
babelHelpers.classCallCheck(this, _class5);
};
babelHelpers.createClass(_class5, {
m1: {
value: function m1() {}
},
m2: {
value: function m2() {}
}
});
return _class5;
})());
babelHelpers.createClass(_class5, [{
key: "m1",
value: function m1() {}
}, {
key: "m2",
value: function m2() {}
}]);
return _class5;
})());

View File

@@ -1,4 +1,4 @@
"use strict";
babelHelpers.applyConstructor(Numbers, babelHelpers.toConsumableArray(nums));
babelHelpers.applyConstructor(Numbers, [1].concat(babelHelpers.toConsumableArray(nums)));
new (babelHelpers.bind.apply(Numbers, babelHelpers.toConsumableArray(nums)))();
new (babelHelpers.bind.apply(Numbers, [1].concat(babelHelpers.toConsumableArray(nums))))();

View File

@@ -1,3 +1,3 @@
"use strict";
var t = "'" + foo + "' \"" + bar + "\"";
var t = "'" + String(foo) + "' \"" + String(bar) + "\"";

View File

@@ -1,3 +1,3 @@
"use strict";
var foo = "test " + _.test(foo) + " " + bar;
var foo = "test " + String(_.test(foo)) + " " + String(bar);

View File

@@ -1,3 +1,3 @@
"use strict";
var foo = "test " + foo + " " + bar;
var foo = "test " + String(foo) + " " + String(bar);

View File

@@ -1,3 +1,3 @@
"use strict";
var foo = "" + test;
var foo = "" + String(test);

View File

@@ -1,3 +1,3 @@
"use strict";
var foo = "test " + foo;
var foo = "test " + String(foo);

View File

@@ -1,3 +1,3 @@
"use strict";
var foo = "test " + (foo + bar);
var foo = "test " + String(foo + bar);

View File

@@ -1,4 +1,4 @@
{
"whitelist": ["flow", "es7.asyncFunctions"],
"whitelist": ["flow", "es7.asyncFunctions", "es7.classProperties"],
"noCheckAst": true
}

View File

@@ -1,24 +1,18 @@
"use strict";
var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
var Test = (function () {
function Test() {
_classCallCheck(this, Test);
babelHelpers.classCallCheck(this, Test);
}
_createClass(Test, {
bar: {
get: function () {
throw new Error("wow");
}
babelHelpers.createClass(Test, [{
key: "bar",
get: function () {
throw new Error("wow");
}
});
}]);
return Test;
})();
var test = new Test();
test.bar;
test.bar;

View File

@@ -44,5 +44,5 @@ var i = function () {
// assignment to self
var j = function () {
({ j }) = 5;
({ j } = 5);
};

View File

@@ -74,6 +74,6 @@ var i = (function (_i) {
// assignment to self
var j = function j() {
var _ref = 5;
j = _ref.j;
};
var _ = 5;
j = _.j;
};

View File

@@ -2,10 +2,10 @@
var _defaults = function (obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; };
var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) _defaults(subClass, superClass); };
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) _defaults(subClass, superClass); };
var Foo = (function (_Bar) {
function Foo() {
_classCallCheck(this, Foo);
@@ -18,4 +18,4 @@ var Foo = (function (_Bar) {
_inherits(Foo, _Bar);
return Foo;
})(Bar);
})(Bar);