diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-02-17 21:33:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-17 21:33:36 +0800 |
commit | 82d1ef02422ac378a524f916d0a29b9ce35743b4 (patch) | |
tree | 5a92e9832524688a619397457917aa03d3fec90e /test/compress | |
parent | 7fdd2082a65fd11d3d99c5e62241264ae6e82afc (diff) | |
download | tracifyjs-82d1ef02422ac378a524f916d0a29b9ce35743b4.tar.gz tracifyjs-82d1ef02422ac378a524f916d0a29b9ce35743b4.zip |
fix `unsafe` `evaluate` of `function` property (#2927)
fixes #2926
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/evaluate.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js index 2294ca01..614020ea 100644 --- a/test/compress/evaluate.js +++ b/test/compress/evaluate.js @@ -1502,3 +1502,36 @@ issue_2919: { console.log("function(){}"); } } + +issue_2926_1: { + options = { + evaluate: true, + reduce_vars: true, + unsafe: true, + } + input: { + (function f(a) { + console.log(f.name.length, f.length); + })(); + } + expect: { + (function f(a) { + console.log(1, 1); + })(); + } + expect_stdout: "1 1" +} + +issue_2926_2: { + options = { + evaluate: true, + unsafe: true, + } + input: { + console.log(typeof function() {}.valueOf()); + } + expect: { + console.log("function"); + } + expect_stdout: "function" +} |