handle computed properties correctly

This commit is contained in:
alexlamsl
2017-10-29 17:42:25 +08:00
parent 3ae34177a6
commit 0a9cdb6c73
2 changed files with 30 additions and 1 deletions

View File

@@ -1258,3 +1258,27 @@ array_hole: {
}
expect_stdout: "2 undefined 3"
}
computed_property: {
options = {
properties: true,
side_effects: true,
}
input: {
console.log({
a: "bar",
[console.log("foo")]: 42,
}.a);
}
expect: {
console.log([
"bar",
console.log("foo")
][0]);
}
expect_stdout: [
"foo",
"bar"
]
node_version: ">=4"
}