aboutsummaryrefslogtreecommitdiff
path: root/test/compress/properties.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-06-01 18:11:16 +0800
committerGitHub <noreply@github.com>2017-06-01 18:11:16 +0800
commitbac14ba881729fa573effa1fb4afdb76a7c5662e (patch)
tree29c8603a70e4b1f888c94abfd3aede5c24a826c0 /test/compress/properties.js
parentec095ed647691b3458ec9e65e89ff92d5151abc4 (diff)
downloadtracifyjs-bac14ba881729fa573effa1fb4afdb76a7c5662e.tar.gz
tracifyjs-bac14ba881729fa573effa1fb4afdb76a7c5662e.zip
fix non-identifier getter/setter name (#2041)
fixes #2040
Diffstat (limited to 'test/compress/properties.js')
-rw-r--r--test/compress/properties.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/compress/properties.js b/test/compress/properties.js
index 3e06dc1e..d49b9ea4 100644
--- a/test/compress/properties.js
+++ b/test/compress/properties.js
@@ -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"
+}