aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-02-15 06:41:07 +0000
committerGitHub <noreply@github.com>2021-02-15 14:41:07 +0800
commit76b27891c6f834d35da3b6dc6d25ad53c4f3bc36 (patch)
tree0aa0057d9b6618ed39d4bd5751022b79926d666c
parent203ca2586a759ac2fce057e80ae9195d28ef247e (diff)
downloadtracifyjs-76b27891c6f834d35da3b6dc6d25ad53c4f3bc36.tar.gz
tracifyjs-76b27891c6f834d35da3b6dc6d25ad53c4f3bc36.zip
fix syntax error in tests (#4652)
-rw-r--r--test/compress/evaluate.js8
-rw-r--r--test/compress/issue-12.js58
2 files changed, 41 insertions, 25 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js
index f579ee72..597c7c87 100644
--- a/test/compress/evaluate.js
+++ b/test/compress/evaluate.js
@@ -399,18 +399,18 @@ unsafe_object_accessor: {
function f() {
var a = {
get b() {},
- set b() {}
+ set b(v) {},
};
- return {a:a};
+ return { a: a };
}
}
expect: {
function f() {
var a = {
get b() {},
- set b() {}
+ set b(v) {},
};
- return {a:a};
+ return { a: a };
}
}
}
diff --git a/test/compress/issue-12.js b/test/compress/issue-12.js
index 34f48cba..e2bd384c 100644
--- a/test/compress/issue-12.js
+++ b/test/compress/issue-12.js
@@ -2,61 +2,77 @@ keep_name_of_getter: {
options = {
unused: true,
}
- input: { a = { get foo () {} } }
- expect: { a = { get foo () {} } }
+ input: {
+ a = {
+ get foo() {},
+ };
+ }
+ expect: {
+ a = {
+ get foo() {},
+ };
+ }
}
keep_name_of_setter: {
options = {
unused: true,
}
- input: { a = { set foo () {} } }
- expect: { a = { set foo () {} } }
+ input: {
+ a = {
+ set foo(v) {},
+ };
+ }
+ expect: {
+ a = {
+ set foo(v) {},
+ };
+ }
}
setter_with_operator_keys: {
input: {
- var tokenCodes = {
- get instanceof(){
+ var tokenCodes = {
+ get instanceof() {
return test0;
},
- set instanceof(value){
+ set instanceof(value) {
test0 = value;
},
- set typeof(value){
+ set typeof(value) {
test1 = value;
},
- get typeof(){
+ get typeof() {
return test1;
},
- set else(value){
+ set else(value) {
test2 = value;
},
- get else(){
+ get else() {
return test2;
- }
+ },
};
}
expect: {
- var tokenCodes = {
- get instanceof(){
+ var tokenCodes = {
+ get instanceof() {
return test0;
},
- set instanceof(value){
+ set instanceof(value) {
test0 = value;
},
- set typeof(value){
+ set typeof(value) {
test1 = value;
},
- get typeof(){
+ get typeof() {
return test1;
},
- set else(value){
+ set else(value) {
test2 = value;
},
- get else(){
+ get else() {
return test2;
- }
+ },
};
}
-} \ No newline at end of file
+}