From 3c1898fd65a63e1bed7fe813e69f45ee79e2019a Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 13 May 2021 12:57:36 +0100 Subject: suppress invalid test case generation (#4930) --- test/reduce.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/reduce.js') 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 -- cgit v1.2.3