fix syntax error in tests (#4652)
authorAlex Lam S.L <alexlamsl@gmail.com>
Mon, 15 Feb 2021 06:41:07 +0000 (06:41 +0000)
committerGitHub <noreply@github.com>
Mon, 15 Feb 2021 06:41:07 +0000 (14:41 +0800)
test/compress/evaluate.js
test/compress/issue-12.js

index f579ee7..597c7c8 100644 (file)
@@ -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 };
         }
     }
 }
index 34f48cb..e2bd384 100644 (file)
@@ -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
+}