From: Mihai Bazon Date: Fri, 18 Apr 2014 07:47:38 +0000 (+0300) Subject: Always quote property names that contain non-ASCII characters. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=8fbe20001215887275b3cf053be675ebdbf331a9;p=UglifyJS.git Always quote property names that contain non-ASCII characters. Fix #328 --- diff --git a/lib/parse.js b/lib/parse.js index b061067e..de982b1e 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -168,14 +168,7 @@ function is_identifier_char(ch) { }; function is_identifier_string(str){ - var i = str.length; - if (i == 0) return false; - if (!is_identifier_start(str.charCodeAt(0))) return false; - while (--i >= 0) { - if (!is_identifier_char(str.charAt(i))) - return false; - } - return true; + return /^[a-z_$][a-z0-9_$]*$/i.test(str); }; function parse_js_number(num) {