Revert "remove es7.abstractReferences, playground.methodBinding and playground.objectGetterMemoisation"

This reverts commit f4ce216d1c.
This commit is contained in:
Sebastian McKenzie
2015-03-16 01:02:35 +11:00
parent 5ee9b3c37e
commit a8cedf813b
21 changed files with 405 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
foo::bar();
foo::bar("arg");
var test = "test";
test::bar();
test::bar("arg");

View 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");

View File

@@ -0,0 +1,3 @@
delete foo::bar;
if (delete foo::bar) {}

View File

@@ -0,0 +1,5 @@
"use strict";
bar[Symbol.referenceDelete](foo);
if ((bar[Symbol.referenceDelete](foo), true)) {}

View File

@@ -0,0 +1 @@
foo::bar;

View File

@@ -0,0 +1,3 @@
"use strict";
bar[Symbol.referenceGet](foo);

View File

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

View 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;
};

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

View File

@@ -0,0 +1,3 @@
var baz = "foo";
foo::bar = baz;
if (foo::bar = baz) {}

View File

@@ -0,0 +1,5 @@
"use strict";
var baz = "foo";
bar[Symbol.referenceSet](foo, baz);
if ((bar[Symbol.referenceSet](foo, baz), baz)) {}

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

View 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"]);

View 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]);
}));

View File

@@ -0,0 +1,3 @@
{
"blacklist": ["es6.tailCall"]
}

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

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