From 4b4528ee0552edb7ba1d24dad89e29880065e1c0 Mon Sep 17 00:00:00 2001 From: Richard van Velzen Date: Tue, 12 Apr 2016 20:30:44 +0200 Subject: Prevent endless recursion when evaluating self-referencing consts Fix #1041 --- test/compress/issue-1041.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 test/compress/issue-1041.js (limited to 'test/compress') 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 || {}; + } +} -- cgit v1.2.3