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
This commit is contained in:
Anthony Van de Gejuchte
2016-06-13 21:11:08 +02:00
committed by Richard van Velzen
parent d7971ba0e4
commit 2149bfb707
8 changed files with 361 additions and 15 deletions

View File

@@ -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) {