diff options
author | Richard van Velzen <rvanvelzen@experty.com> | 2016-04-12 20:30:44 +0200 |
---|---|---|
committer | Richard van Velzen <rvanvelzen@experty.com> | 2016-04-13 15:03:31 +0200 |
commit | 4b4528ee0552edb7ba1d24dad89e29880065e1c0 (patch) | |
tree | a015dbb287a2dd0ad27c95beb54dfc6ba0949a02 /test/compress/issue-1041.js | |
parent | 187a0caf9d2b283387b57b71dea6aa133b266638 (diff) | |
download | tracifyjs-4b4528ee0552edb7ba1d24dad89e29880065e1c0.tar.gz tracifyjs-4b4528ee0552edb7ba1d24dad89e29880065e1c0.zip |
Prevent endless recursion when evaluating self-referencing consts
Fix #1041
Diffstat (limited to 'test/compress/issue-1041.js')
-rw-r--r-- | test/compress/issue-1041.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/compress/issue-1041.js b/test/compress/issue-1041.js new file mode 100644 index 00000000..9dd176fd --- /dev/null +++ b/test/compress/issue-1041.js @@ -0,0 +1,39 @@ +const_declaration: { + options = { + evaluate: true + }; + + input: { + const goog = goog || {}; + } + expect: { + const goog = goog || {}; + } +} + +const_pragma: { + options = { + evaluate: true + }; + + input: { + /** @const */ var goog = goog || {}; + } + expect: { + var goog = goog || {}; + } +} + +// for completeness' sake +not_const: { + options = { + evaluate: true + }; + + input: { + var goog = goog || {}; + } + expect: { + var goog = goog || {}; + } +} |