From: Alex Lam S.L Date: Fri, 23 Mar 2018 20:05:28 +0000 (+0800) Subject: speed up `has_parens()` (#3014) X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=b1410be443e5ebce98a0a4438da9a8c9618e18fc;p=UglifyJS.git speed up `has_parens()` (#3014) --- diff --git a/lib/output.js b/lib/output.js index 6c1d61a3..f60b474c 100644 --- a/lib/output.js +++ b/lib/output.js @@ -576,7 +576,7 @@ function OutputStream(options) { indentation : function() { return indentation }, current_width : function() { return current_col - indentation }, should_break : function() { return options.width && this.current_width() >= options.width }, - has_parens : function() { return OUTPUT.slice(-1) == "(" }, + has_parens : function() { return OUTPUT[OUTPUT.length - 1] == "(" }, newline : newline, print : print, space : space,