add computed property names support

This commit is contained in:
Sebastian McKenzie
2014-09-29 03:43:21 +10:00
parent d87c7942a3
commit 99fb31638e
7 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
var obj = {
["x" + foo]: "heh",
["y" + bar]: "noo",
foo: "foo",
bar: "bar"
};

View File

@@ -0,0 +1,8 @@
var obj = function (obj) {
obj["x" + foo] = "heh";
obj["y" + bar] = "noo";
return obj;
}({
foo: "foo",
bar: "bar"
});

View File

@@ -0,0 +1,4 @@
var obj = {
["x" + foo]: "heh",
["y" + bar]: "noo"
};

View File

@@ -0,0 +1,5 @@
var obj = function (obj) {
obj["x" + foo] = "heh";
obj["y" + bar] = "noo";
return obj;
}({});

View File

@@ -0,0 +1,3 @@
var obj = {
["x" + foo]: "heh"
};

View File

@@ -0,0 +1,4 @@
var obj = function (obj) {
obj["x" + foo] = "heh";
return obj;
}({});