diff options
Diffstat (limited to 'test/compress/dead-code.js')
-rw-r--r-- | test/compress/dead-code.js | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js index 0fcbbe43..abf5297c 100644 --- a/test/compress/dead-code.js +++ b/test/compress/dead-code.js @@ -230,3 +230,82 @@ accessor: { } expect: {} } + +issue_2233_1: { + options = { + pure_getters: "strict", + side_effects: true, + unsafe: true, + } + input: { + Array.isArray; + Boolean; + console.log; + Error.name; + Function.length; + Math.random; + Number.isNaN; + RegExp; + Object.defineProperty; + String.fromCharCode; + } + expect: {} + expect_stdout: true +} + +issue_2233_2: { + options = { + pure_getters: "strict", + reduce_vars: true, + side_effects: true, + unsafe: true, + unused: true, + } + input: { + var RegExp; + Array.isArray; + RegExp; + UndeclaredGlobal; + function foo() { + var Number; + AnotherUndeclaredGlobal; + Math.sin; + Number.isNaN; + } + } + expect: { + var RegExp; + UndeclaredGlobal; + function foo() { + var Number; + AnotherUndeclaredGlobal; + Number.isNaN; + } + } +} + +issue_2233_3: { + options = { + pure_getters: "strict", + reduce_vars: true, + side_effects: true, + toplevel: true, + unsafe: true, + unused: true, + } + input: { + var RegExp; + Array.isArray; + RegExp; + UndeclaredGlobal; + function foo() { + var Number; + AnotherUndeclaredGlobal; + Math.sin; + Number.isNaN; + } + } + expect: { + UndeclaredGlobal; + } +} |