fix non-identifier getter/setter name (#2041)

fixes #2040
This commit is contained in:
Alex Lam S.L
2017-06-01 18:11:16 +08:00
committed by GitHub
parent ec095ed647
commit bac14ba881
2 changed files with 31 additions and 11 deletions

View File

@@ -555,3 +555,20 @@ native_prototype: {
"".indexOf.call(e, "bar");
}
}
issue_2040: {
input: {
var a = 1;
var b = {
get "a-b"() {
return a;
},
set "a-b"(c) {
a = c;
}
};
console.log(b["a-b"], b["a-b"] = 2, b["a-b"]);
}
expect_exact: 'var a=1;var b={get"a-b"(){return a},set"a-b"(c){a=c}};console.log(b["a-b"],b["a-b"]=2,b["a-b"]);'
expect_stdout: "1 2 2"
}