Revert "remove es7.abstractReferences, playground.methodBinding and playground.objectGetterMemoisation"
This reverts commit f4ce216d1c.
This commit is contained in:
6
test/fixtures/transformation/es7-abstract-references/call/actual.js
vendored
Normal file
6
test/fixtures/transformation/es7-abstract-references/call/actual.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
foo::bar();
|
||||
foo::bar("arg");
|
||||
|
||||
var test = "test";
|
||||
test::bar();
|
||||
test::bar("arg");
|
||||
10
test/fixtures/transformation/es7-abstract-references/call/expected.js
vendored
Normal file
10
test/fixtures/transformation/es7-abstract-references/call/expected.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
var _foo, _foo2;
|
||||
|
||||
_foo = foo, bar[Symbol.referenceGet](_foo).call(_foo);
|
||||
_foo2 = foo, bar[Symbol.referenceGet](_foo2).call(_foo2, "arg");
|
||||
|
||||
var test = "test";
|
||||
bar[Symbol.referenceGet](test).call(test);
|
||||
bar[Symbol.referenceGet](test).call(test, "arg");
|
||||
3
test/fixtures/transformation/es7-abstract-references/delete/actual.js
vendored
Normal file
3
test/fixtures/transformation/es7-abstract-references/delete/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
delete foo::bar;
|
||||
|
||||
if (delete foo::bar) {}
|
||||
5
test/fixtures/transformation/es7-abstract-references/delete/expected.js
vendored
Normal file
5
test/fixtures/transformation/es7-abstract-references/delete/expected.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
bar[Symbol.referenceDelete](foo);
|
||||
|
||||
if ((bar[Symbol.referenceDelete](foo), true)) {}
|
||||
1
test/fixtures/transformation/es7-abstract-references/get/actual.js
vendored
Normal file
1
test/fixtures/transformation/es7-abstract-references/get/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
foo::bar;
|
||||
3
test/fixtures/transformation/es7-abstract-references/get/expected.js
vendored
Normal file
3
test/fixtures/transformation/es7-abstract-references/get/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
bar[Symbol.referenceGet](foo);
|
||||
3
test/fixtures/transformation/es7-abstract-references/options.json
vendored
Normal file
3
test/fixtures/transformation/es7-abstract-references/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"experimental": true
|
||||
}
|
||||
12
test/fixtures/transformation/es7-abstract-references/private/actual.js
vendored
Normal file
12
test/fixtures/transformation/es7-abstract-references/private/actual.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
private A;
|
||||
private B, C;
|
||||
|
||||
class D {
|
||||
private E;
|
||||
private F, G;
|
||||
}
|
||||
|
||||
var H = class {
|
||||
private I;
|
||||
private J, K;
|
||||
};
|
||||
30
test/fixtures/transformation/es7-abstract-references/private/expected.js
vendored
Normal file
30
test/fixtures/transformation/es7-abstract-references/private/expected.js
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
|
||||
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
|
||||
|
||||
var A = new WeakMap();
|
||||
var B = new WeakMap(),
|
||||
C = new WeakMap();
|
||||
|
||||
var D = (function () {
|
||||
var F = new WeakMap(),
|
||||
G = new WeakMap();
|
||||
var E = new WeakMap();
|
||||
|
||||
function D() {
|
||||
_classCallCheck(this, D);
|
||||
}
|
||||
|
||||
return D;
|
||||
})();
|
||||
|
||||
var H = (function () {
|
||||
var _class = function H() {
|
||||
_classCallCheck(this, _class);
|
||||
};
|
||||
|
||||
var J = new WeakMap(),
|
||||
K = new WeakMap();
|
||||
var I = new WeakMap();
|
||||
return _class;
|
||||
})();
|
||||
3
test/fixtures/transformation/es7-abstract-references/set/actual.js
vendored
Normal file
3
test/fixtures/transformation/es7-abstract-references/set/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
var baz = "foo";
|
||||
foo::bar = baz;
|
||||
if (foo::bar = baz) {}
|
||||
5
test/fixtures/transformation/es7-abstract-references/set/expected.js
vendored
Normal file
5
test/fixtures/transformation/es7-abstract-references/set/expected.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
var baz = "foo";
|
||||
bar[Symbol.referenceSet](foo, baz);
|
||||
if ((bar[Symbol.referenceSet](foo, baz), baz)) {}
|
||||
13
test/fixtures/transformation/playground/method-binding/actual.js
vendored
Normal file
13
test/fixtures/transformation/playground/method-binding/actual.js
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
var fn = obj#method;
|
||||
var fn = obj#method("foob");
|
||||
var fn = obj[foo]#method;
|
||||
var fn = obj.foo#method;
|
||||
var fn = obj[foo()]#method;
|
||||
|
||||
["foo", "bar"].map(#toUpperCase);
|
||||
[1.1234, 23.53245, 3].map(#toFixed(2));
|
||||
|
||||
var get = function () {
|
||||
return 2;
|
||||
};
|
||||
[1.1234, 23.53245, 3].map(#toFixed(get()));
|
||||
30
test/fixtures/transformation/playground/method-binding/exec.js
vendored
Normal file
30
test/fixtures/transformation/playground/method-binding/exec.js
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
var obj = {
|
||||
foo: "foo",
|
||||
bar: "bar",
|
||||
getFoo: function () {
|
||||
return this.foo;
|
||||
},
|
||||
getBar: function (arg) {
|
||||
return arg + " " + this.bar;
|
||||
},
|
||||
getZoo: function (a, b) {
|
||||
return this.foo + " " + this.bar + " " + a + " " + b;
|
||||
}
|
||||
};
|
||||
|
||||
var foo = obj#getFoo;
|
||||
assert.equal(foo(), "foo");
|
||||
|
||||
var bar = obj#getBar("foo");
|
||||
assert.equal(bar(), "foo bar");
|
||||
|
||||
var zoo = obj#getZoo("foo");
|
||||
assert.equal(zoo("bar"), "foo bar foo bar");
|
||||
|
||||
assert.deepEqual(["foo", "bar"].map(#toUpperCase), ["FOO", "BAR"]);
|
||||
assert.deepEqual([1.1234, 23.53245, 3].map(#toFixed(2)), ["1.12", "23.53", "3.00"]);
|
||||
|
||||
var get = function () {
|
||||
return 2;
|
||||
}
|
||||
assert.deepEqual([1.1234, 23.53245, 3].map(#toFixed(get())), ["1.12", "23.53", "3.00"]);
|
||||
23
test/fixtures/transformation/playground/method-binding/expected.js
vendored
Normal file
23
test/fixtures/transformation/playground/method-binding/expected.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
var _obj, _obj2, _obj$foo, _obj$foo2, _obj$foo3, _args, _args2, _args3;
|
||||
|
||||
var fn = (_obj = obj, _obj.method.bind(_obj));
|
||||
var fn = (_obj2 = obj, _obj2.method.bind(_obj2, "foob"));
|
||||
var fn = (_obj$foo = obj[foo], _obj$foo.method.bind(_obj$foo));
|
||||
var fn = (_obj$foo2 = obj.foo, _obj$foo2.method.bind(_obj$foo2));
|
||||
var fn = (_obj$foo3 = obj[foo()], _obj$foo3.method.bind(_obj$foo3));
|
||||
|
||||
["foo", "bar"].map((_args = [], function (_val) {
|
||||
return _val.toUpperCase();
|
||||
}));
|
||||
[1.1234, 23.53245, 3].map((_args2 = [2], function (_val2) {
|
||||
return _val2.toFixed(_args2[0]);
|
||||
}));
|
||||
|
||||
var get = function get() {
|
||||
return 2;
|
||||
};
|
||||
[1.1234, 23.53245, 3].map((_args3 = [get()], function (_val3) {
|
||||
return _val3.toFixed(_args3[0]);
|
||||
}));
|
||||
3
test/fixtures/transformation/playground/method-binding/options.json
vendored
Normal file
3
test/fixtures/transformation/playground/method-binding/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"blacklist": ["es6.tailCall"]
|
||||
}
|
||||
19
test/fixtures/transformation/playground/object-getter-memoization/actual.js
vendored
Normal file
19
test/fixtures/transformation/playground/object-getter-memoization/actual.js
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
class Foo {
|
||||
memo bar() {
|
||||
return complex();
|
||||
}
|
||||
|
||||
memo [bar]() {
|
||||
return complex();
|
||||
}
|
||||
}
|
||||
|
||||
var foo = {
|
||||
memo bar() {
|
||||
return complex();
|
||||
},
|
||||
|
||||
memo [bar]() {
|
||||
return complex();
|
||||
}
|
||||
};
|
||||
36
test/fixtures/transformation/playground/object-getter-memoization/expected.js
vendored
Normal file
36
test/fixtures/transformation/playground/object-getter-memoization/expected.js
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
}
|
||||
|
||||
babelHelpers.createComputedClass(Foo, [{
|
||||
key: "bar",
|
||||
get: function () {
|
||||
return babelHelpers.defineProperty(this, "bar", complex()).bar;
|
||||
}
|
||||
}, {
|
||||
key: bar,
|
||||
get: function () {
|
||||
return babelHelpers.defineProperty(this, bar, complex())[bar];
|
||||
}
|
||||
}]);
|
||||
return Foo;
|
||||
})();
|
||||
|
||||
var foo = Object.defineProperties({}, babelHelpers.defineProperty({
|
||||
bar: {
|
||||
get: function () {
|
||||
return babelHelpers.defineProperty(this, "bar", complex()).bar;
|
||||
},
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
}
|
||||
}, bar, {
|
||||
get: function () {
|
||||
return babelHelpers.defineProperty(this, bar, complex())[bar];
|
||||
},
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
}));
|
||||
Reference in New Issue
Block a user