add loose option to computed property names
This commit is contained in:
3
test/fixtures/transformation/es6-computed-property-names-loose/argument/actual.js
vendored
Normal file
3
test/fixtures/transformation/es6-computed-property-names-loose/argument/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
foo({
|
||||
[bar]: "foobar"
|
||||
});
|
||||
8
test/fixtures/transformation/es6-computed-property-names-loose/argument/expected.js
vendored
Normal file
8
test/fixtures/transformation/es6-computed-property-names-loose/argument/expected.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
foo((function () {
|
||||
var _foo = {};
|
||||
|
||||
_foo[bar] = "foobar";
|
||||
return _foo;
|
||||
})());
|
||||
3
test/fixtures/transformation/es6-computed-property-names-loose/assignment/actual.js
vendored
Normal file
3
test/fixtures/transformation/es6-computed-property-names-loose/assignment/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
foo = {
|
||||
[bar]: "foobar"
|
||||
};
|
||||
8
test/fixtures/transformation/es6-computed-property-names-loose/assignment/expected.js
vendored
Normal file
8
test/fixtures/transformation/es6-computed-property-names-loose/assignment/expected.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
foo = (function () {
|
||||
var _foo = {};
|
||||
|
||||
_foo[bar] = "foobar";
|
||||
return _foo;
|
||||
})();
|
||||
3
test/fixtures/transformation/es6-computed-property-names-loose/ignore-symbol/actual.js
vendored
Normal file
3
test/fixtures/transformation/es6-computed-property-names-loose/ignore-symbol/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
var foo = {
|
||||
[Symbol.iterator]: "foobar"
|
||||
};
|
||||
8
test/fixtures/transformation/es6-computed-property-names-loose/ignore-symbol/expected.js
vendored
Normal file
8
test/fixtures/transformation/es6-computed-property-names-loose/ignore-symbol/expected.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
var foo = (function () {
|
||||
var _foo = {};
|
||||
|
||||
_foo[Symbol.iterator] = "foobar";
|
||||
return _foo;
|
||||
})();
|
||||
5
test/fixtures/transformation/es6-computed-property-names-loose/method/actual.js
vendored
Normal file
5
test/fixtures/transformation/es6-computed-property-names-loose/method/actual.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
var obj = {
|
||||
[foobar]() {
|
||||
return "foobar";
|
||||
}
|
||||
};
|
||||
11
test/fixtures/transformation/es6-computed-property-names-loose/method/expected.js
vendored
Normal file
11
test/fixtures/transformation/es6-computed-property-names-loose/method/expected.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
var obj = (function () {
|
||||
var _obj = {};
|
||||
|
||||
_obj[foobar] = function () {
|
||||
return "foobar";
|
||||
};
|
||||
|
||||
return _obj;
|
||||
})();
|
||||
6
test/fixtures/transformation/es6-computed-property-names-loose/mixed/actual.js
vendored
Normal file
6
test/fixtures/transformation/es6-computed-property-names-loose/mixed/actual.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
var obj = {
|
||||
["x" + foo]: "heh",
|
||||
["y" + bar]: "noo",
|
||||
foo: "foo",
|
||||
bar: "bar"
|
||||
};
|
||||
11
test/fixtures/transformation/es6-computed-property-names-loose/mixed/expected.js
vendored
Normal file
11
test/fixtures/transformation/es6-computed-property-names-loose/mixed/expected.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
var obj = (function () {
|
||||
var _obj = {};
|
||||
|
||||
_obj["x" + foo] = "heh";
|
||||
_obj["y" + bar] = "noo";
|
||||
_obj.foo = "foo";
|
||||
_obj.bar = "bar";
|
||||
return _obj;
|
||||
})();
|
||||
4
test/fixtures/transformation/es6-computed-property-names-loose/multiple/actual.js
vendored
Normal file
4
test/fixtures/transformation/es6-computed-property-names-loose/multiple/actual.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
var obj = {
|
||||
["x" + foo]: "heh",
|
||||
["y" + bar]: "noo"
|
||||
};
|
||||
9
test/fixtures/transformation/es6-computed-property-names-loose/multiple/expected.js
vendored
Normal file
9
test/fixtures/transformation/es6-computed-property-names-loose/multiple/expected.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
var obj = (function () {
|
||||
var _obj = {};
|
||||
|
||||
_obj["x" + foo] = "heh";
|
||||
_obj["y" + bar] = "noo";
|
||||
return _obj;
|
||||
})();
|
||||
3
test/fixtures/transformation/es6-computed-property-names-loose/options.json
vendored
Normal file
3
test/fixtures/transformation/es6-computed-property-names-loose/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"loose": ["computedPropertyNames"]
|
||||
}
|
||||
3
test/fixtures/transformation/es6-computed-property-names-loose/single/actual.js
vendored
Normal file
3
test/fixtures/transformation/es6-computed-property-names-loose/single/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
var obj = {
|
||||
["x" + foo]: "heh"
|
||||
};
|
||||
8
test/fixtures/transformation/es6-computed-property-names-loose/single/expected.js
vendored
Normal file
8
test/fixtures/transformation/es6-computed-property-names-loose/single/expected.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
var obj = (function () {
|
||||
var _obj = {};
|
||||
|
||||
_obj["x" + foo] = "heh";
|
||||
return _obj;
|
||||
})();
|
||||
3
test/fixtures/transformation/es6-computed-property-names-loose/this/actual.js
vendored
Normal file
3
test/fixtures/transformation/es6-computed-property-names-loose/this/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
var obj = {
|
||||
["x" + this.foo]: "heh"
|
||||
};
|
||||
9
test/fixtures/transformation/es6-computed-property-names-loose/this/expected.js
vendored
Normal file
9
test/fixtures/transformation/es6-computed-property-names-loose/this/expected.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
var _this = this;
|
||||
var obj = (function () {
|
||||
var _obj = {};
|
||||
|
||||
_obj["x" + _this.foo] = "heh";
|
||||
return _obj;
|
||||
})();
|
||||
4
test/fixtures/transformation/es6-computed-property-names-loose/two/actual.js
vendored
Normal file
4
test/fixtures/transformation/es6-computed-property-names-loose/two/actual.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
var obj = {
|
||||
first: "first",
|
||||
["second"]: "second",
|
||||
};
|
||||
9
test/fixtures/transformation/es6-computed-property-names-loose/two/expected.js
vendored
Normal file
9
test/fixtures/transformation/es6-computed-property-names-loose/two/expected.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
var obj = (function () {
|
||||
var _obj = {};
|
||||
|
||||
_obj.first = "first";
|
||||
_obj.second = "second";
|
||||
return _obj;
|
||||
})();
|
||||
3
test/fixtures/transformation/es6-computed-property-names-loose/variable/actual.js
vendored
Normal file
3
test/fixtures/transformation/es6-computed-property-names-loose/variable/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
var foo = {
|
||||
[bar]: "foobar"
|
||||
};
|
||||
8
test/fixtures/transformation/es6-computed-property-names-loose/variable/expected.js
vendored
Normal file
8
test/fixtures/transformation/es6-computed-property-names-loose/variable/expected.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
var foo = (function () {
|
||||
var _foo = {};
|
||||
|
||||
_foo[bar] = "foobar";
|
||||
return _foo;
|
||||
})();
|
||||
Reference in New Issue
Block a user