diff options
author | Anthony Van de Gejuchte <anthonyvdgent@gmail.com> | 2016-06-13 21:11:08 +0200 |
---|---|---|
committer | Richard van Velzen <rvanvelzen1@gmail.com> | 2016-06-19 20:59:17 +0200 |
commit | 2149bfb7071dedbcd42d2e245bb9c2f6b41a43bc (patch) | |
tree | 0d389df29100365c26b97224ba436c5b0dbd222c /tools | |
parent | d7971ba0e439eb042fd880762bc7fa77ce1f3e73 (diff) | |
download | tracifyjs-2149bfb7071dedbcd42d2e245bb9c2f6b41a43bc.tar.gz tracifyjs-2149bfb7071dedbcd42d2e245bb9c2f6b41a43bc.zip |
Don't mix strings with directives in output
* Don't interpret strings with escaped content as directive
* Don't interpret strings after empty statement as directive
* Adapt output to prevent strings being represent as directive
* Introduce UGLIFY_DEBUG to allow internal testing like EXPECT_DIRECTIVE
Diffstat (limited to 'tools')
-rw-r--r-- | tools/exports.js | 4 | ||||
-rw-r--r-- | tools/node.js | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/tools/exports.js b/tools/exports.js index 09acc13e..a481143c 100644 --- a/tools/exports.js +++ b/tools/exports.js @@ -17,3 +17,7 @@ exports["string_template"] = string_template; exports["tokenizer"] = tokenizer; exports["is_identifier"] = is_identifier; exports["SymbolDef"] = SymbolDef; + +if (DEBUG) { + exports["EXPECT_DIRECTIVE"] = EXPECT_DIRECTIVE; +} diff --git a/tools/node.js b/tools/node.js index 8cd3e4be..39976371 100644 --- a/tools/node.js +++ b/tools/node.js @@ -25,11 +25,12 @@ var FILES = exports.FILES = [ var UglifyJS = exports; -new Function("MOZ_SourceMap", "exports", FILES.map(function(file){ +new Function("MOZ_SourceMap", "exports", "DEBUG", FILES.map(function(file){ return fs.readFileSync(file, "utf8"); }).join("\n\n"))( require("source-map"), - UglifyJS + UglifyJS, + !!global.UGLIFY_DEBUG ); UglifyJS.AST_Node.warn_function = function(txt) { |