diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-05-31 03:38:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-31 03:38:00 +0800 |
commit | e9645e017f297e06506cc139922ff012fb763139 (patch) | |
tree | 0e2510c7a6aae20844829a6510ca6a2c6d95930d /test/compress/functions.js | |
parent | 55b5f2a8aa90a69e523c0a53ca92fcef45e5b209 (diff) | |
download | tracifyjs-e9645e017f297e06506cc139922ff012fb763139.tar.gz tracifyjs-e9645e017f297e06506cc139922ff012fb763139.zip |
introduce `unsafe_Func` (#2033)
Separate flag for #203 functionality.
Diffstat (limited to 'test/compress/functions.js')
-rw-r--r-- | test/compress/functions.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js index 5ebd9d19..6a9f2aed 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -245,3 +245,25 @@ hoist_funs_strict: { ] node_version: ">=4" } + +issue_203: { + options = { + keep_fargs: false, + side_effects: true, + unsafe_Func: true, + unused: true, + } + input: { + var m = {}; + var fn = Function("require", "module", "exports", "module.exports = 42;"); + fn(null, m, m.exports); + console.log(m.exports); + } + expect: { + var m = {}; + var fn = Function("a", "b", "b.exports=42"); + fn(null, m, m.exports); + console.log(m.exports); + } + expect_stdout: "42" +} |