inherit temporary computed property closure name from AssignmentExpressions and VariableDeclarators - #56
This commit is contained in:
3
test/fixtures/syntax/computed-property-names/argument/actual.js
vendored
Normal file
3
test/fixtures/syntax/computed-property-names/argument/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
foo({
|
||||
[bar]: "foobar"
|
||||
});
|
||||
4
test/fixtures/syntax/computed-property-names/argument/expected.js
vendored
Normal file
4
test/fixtures/syntax/computed-property-names/argument/expected.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
foo(function(_ref) {
|
||||
_ref[bar] = "foobar";
|
||||
return _ref;
|
||||
}({}));
|
||||
3
test/fixtures/syntax/computed-property-names/assignment/actual.js
vendored
Normal file
3
test/fixtures/syntax/computed-property-names/assignment/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
foo = {
|
||||
[bar]: "foobar"
|
||||
};
|
||||
4
test/fixtures/syntax/computed-property-names/assignment/expected.js
vendored
Normal file
4
test/fixtures/syntax/computed-property-names/assignment/expected.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
foo = function(_foo) {
|
||||
_foo[bar] = "foobar";
|
||||
return _foo;
|
||||
}({});
|
||||
@@ -1,6 +1,6 @@
|
||||
var obj = function (_ref) {
|
||||
_ref[foobar] = function () {
|
||||
var obj = function (_obj) {
|
||||
_obj[foobar] = function () {
|
||||
return "foobar";
|
||||
};
|
||||
return _ref;
|
||||
return _obj;
|
||||
}({});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
var obj = function (_ref) {
|
||||
_ref["x" + foo] = "heh";
|
||||
_ref["y" + bar] = "noo";
|
||||
return _ref;
|
||||
var obj = function (_obj) {
|
||||
_obj["x" + foo] = "heh";
|
||||
_obj["y" + bar] = "noo";
|
||||
return _obj;
|
||||
}({
|
||||
foo: "foo",
|
||||
bar: "bar"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
var obj = function (_ref) {
|
||||
_ref["x" + foo] = "heh";
|
||||
_ref["y" + bar] = "noo";
|
||||
return _ref;
|
||||
var obj = function (_obj) {
|
||||
_obj["x" + foo] = "heh";
|
||||
_obj["y" + bar] = "noo";
|
||||
return _obj;
|
||||
}({});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var obj = function (_ref) {
|
||||
_ref["x" + foo] = "heh";
|
||||
return _ref;
|
||||
var obj = function (_obj) {
|
||||
_obj["x" + foo] = "heh";
|
||||
return _obj;
|
||||
}({});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
var obj = function (_ref) {
|
||||
_ref["x" + this.foo] = "heh";
|
||||
return _ref;
|
||||
}.call(this, {});
|
||||
var _this = this;
|
||||
var obj = function (_obj) {
|
||||
_obj["x" + _this.foo] = "heh";
|
||||
return _obj;
|
||||
}({});
|
||||
|
||||
3
test/fixtures/syntax/computed-property-names/variable/actual.js
vendored
Normal file
3
test/fixtures/syntax/computed-property-names/variable/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
var foo = {
|
||||
[bar]: "foobar"
|
||||
};
|
||||
4
test/fixtures/syntax/computed-property-names/variable/expected.js
vendored
Normal file
4
test/fixtures/syntax/computed-property-names/variable/expected.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
var foo = function(_foo) {
|
||||
_foo[bar] = "foobar";
|
||||
return _foo;
|
||||
}({});
|
||||
Reference in New Issue
Block a user