From b11c5151bc23f91d3ef63cc952f5b83073029e0c Mon Sep 17 00:00:00 2001 From: Anthony Van de Gejuchte Date: Wed, 30 Nov 2016 21:50:31 +0100 Subject: [PATCH] Fix regression with non-ascii function identifiers Regression since 110a1ac885ba224cbc677e42695e252068edd267 --- lib/output.js | 6 +----- test/compress/functions.js | 8 ++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 test/compress/functions.js diff --git a/lib/output.js b/lib/output.js index 3a21a945..c0b5d7df 100644 --- a/lib/output.js +++ b/lib/output.js @@ -951,11 +951,7 @@ function OutputStream(options) { } } if (self.name instanceof AST_Symbol) { - if (typeof self.name.name === "string" && !is_identifier_string(self.name.name)) { - output.print_string(self.name.name); - } else { - self.name.print(output); - } + self.name.print(output); } else if (nokeyword && self.name instanceof AST_Node) { output.with_square(function() { self.name.print(output); // Computed method name diff --git a/test/compress/functions.js b/test/compress/functions.js new file mode 100644 index 00000000..3a8701b7 --- /dev/null +++ b/test/compress/functions.js @@ -0,0 +1,8 @@ +non_ascii_function_identifier_name: { + input: { + function fooλ(δλ) {} + function λ(δλ) {} + (function λ(δλ) {})() + } + expect_exact: "function fooλ(δλ){}function λ(δλ){}(function λ(δλ){})();" +}