diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-10-14 18:40:54 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-10-14 18:40:54 +0200 |
commit | 9df98e65f842cf3acae09cbdd969966f42d64469 (patch) | |
tree | f071d3e09a342c208fb8e1cd3f5241d64fbfbaf3 /node_modules/uglify-js/lib/output.js | |
parent | 008926b18470e7f394cd640302957b29728a9803 (diff) |
update dependencies
Diffstat (limited to 'node_modules/uglify-js/lib/output.js')
-rw-r--r-- | node_modules/uglify-js/lib/output.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/node_modules/uglify-js/lib/output.js b/node_modules/uglify-js/lib/output.js index 4c873f10d..1aa634501 100644 --- a/node_modules/uglify-js/lib/output.js +++ b/node_modules/uglify-js/lib/output.js @@ -146,7 +146,7 @@ function OutputStream(options) { case "\u2029": return "\\u2029"; case "\ufeff": return "\\ufeff"; case "\0": - return /[0-7]/.test(str.charAt(i+1)) ? "\\x00" : "\\0"; + return /[0-9]/.test(str.charAt(i+1)) ? "\\x00" : "\\0"; } return s; }); @@ -482,13 +482,17 @@ function OutputStream(options) { nodetype.DEFMETHOD("_codegen", generator); }; - var use_asm = false; var in_directive = false; + var active_scope = null; + var use_asm = null; AST_Node.DEFMETHOD("print", function(stream, force_parens){ - var self = this, generator = self._codegen, prev_use_asm = use_asm; - if (self instanceof AST_Directive && self.value == "use asm" && stream.parent() instanceof AST_Scope) { - use_asm = true; + var self = this, generator = self._codegen; + if (self instanceof AST_Scope) { + active_scope = self; + } + else if (!use_asm && self instanceof AST_Directive && self.value == "use asm") { + use_asm = active_scope; } function doit() { self.add_comments(stream); @@ -502,8 +506,8 @@ function OutputStream(options) { doit(); } stream.pop_node(); - if (self instanceof AST_Scope) { - use_asm = prev_use_asm; + if (self === use_asm) { + use_asm = null; } }); AST_Node.DEFMETHOD("_print", AST_Node.prototype.print); @@ -1109,7 +1113,7 @@ function OutputStream(options) { self.expression.print(output); if (self instanceof AST_New && !need_constructor_parens(self, output)) return; - if (self.expression instanceof AST_Lambda) { + if (self.expression instanceof AST_Call || self.expression instanceof AST_Lambda) { output.add_mapping(self.start); } output.with_parens(function(){ |