diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-04-03 15:15:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-03 15:15:01 +0800 |
commit | 81603ecd156f494a6b0c02655c5361152711300d (patch) | |
tree | fe288905905789ee165daee0fcdbef5f48f84cbb /lib/output.js | |
parent | e67553fa550ad355aa1946b5da5051434259a6ba (diff) | |
download | tracifyjs-81603ecd156f494a6b0c02655c5361152711300d.tar.gz tracifyjs-81603ecd156f494a6b0c02655c5361152711300d.zip |
improve performance through `makePredicate()` (#3048)
Diffstat (limited to 'lib/output.js')
-rw-r--r-- | lib/output.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/output.js b/lib/output.js index 7aef3b6a..cad6fd82 100644 --- a/lib/output.js +++ b/lib/output.js @@ -280,7 +280,7 @@ function OutputStream(options) { might_need_semicolon = false; if (prev == ":" && ch == "}" || (!ch || ";}".indexOf(ch) < 0) && prev != ";") { - if (options.semicolons || requireSemicolonChars(ch)) { + if (options.semicolons || requireSemicolonChars[ch]) { OUTPUT += ";"; current_col++; current_pos++; @@ -1244,7 +1244,7 @@ function OutputStream(options) { var expr = self.expression; expr.print(output); var prop = self.property; - if (output.option("ie8") && RESERVED_WORDS(prop)) { + if (output.option("ie8") && RESERVED_WORDS[prop]) { output.print("["); output.add_mapping(self.end); output.print_string(prop); @@ -1356,7 +1356,7 @@ function OutputStream(options) { output.print_string(key); } else if ("" + +key == key && key >= 0) { output.print(make_num(key)); - } else if (RESERVED_WORDS(key) ? !output.option("ie8") : is_identifier_string(key)) { + } else if (RESERVED_WORDS[key] ? !output.option("ie8") : is_identifier_string(key)) { if (quote && output.option("keep_quoted_props")) { output.print_string(key, quote); } else { |