aboutsummaryrefslogtreecommitdiff
path: root/test/reduce.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-05-13 12:57:36 +0100
committerGitHub <noreply@github.com>2021-05-13 19:57:36 +0800
commit3c1898fd65a63e1bed7fe813e69f45ee79e2019a (patch)
treed7d8a1fcec9664c948ee1f92742cb70c1b8ab733 /test/reduce.js
parente04429350f4eff1299afe84967d15093abc091ff (diff)
downloadtracifyjs-3c1898fd65a63e1bed7fe813e69f45ee79e2019a.tar.gz
tracifyjs-3c1898fd65a63e1bed7fe813e69f45ee79e2019a.zip
suppress invalid test case generation (#4930)
Diffstat (limited to 'test/reduce.js')
-rw-r--r--test/reduce.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/reduce.js b/test/reduce.js
index 4b3d3fe6..3f154fa7 100644
--- a/test/reduce.js
+++ b/test/reduce.js
@@ -132,6 +132,8 @@ module.exports = function reduce_test(testcase, minify_options, reduce_options)
return;
}
if (parent instanceof U.AST_VarDef && parent.name === node) return;
+ // preserve class methods
+ if (parent instanceof U.AST_ClassMethod && parent.value === node) return;
// preserve exports
if (parent instanceof U.AST_ExportDeclaration) return;
if (parent instanceof U.AST_ExportDefault) return;
@@ -147,6 +149,9 @@ module.exports = function reduce_test(testcase, minify_options, reduce_options)
if (parent instanceof U.AST_For && parent.init === node && node instanceof U.AST_Definitions) return node;
// preserve for (xxx in/of ...)
if (parent instanceof U.AST_ForEnumeration && parent.init === node) return node;
+ // preserve super(...)
+ if (node.TYPE == "Call" && node.expression instanceof U.AST_Super) return;
+ if (node instanceof U.AST_Super && parent.TYPE == "Call" && parent.expression === node) return node;
// node specific permutations with no parent logic