public
/
UglifyJS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a34a13
)
Always quote property names that contain non-ASCII characters.
author
Mihai Bazon
<mihai@bazon.net>
Fri, 18 Apr 2014 07:47:38 +0000
(10:47 +0300)
committer
Mihai Bazon
<mihai@bazon.net>
Fri, 18 Apr 2014 07:48:44 +0000
(10:48 +0300)
Fix #328
lib/parse.js
patch
|
blob
|
history
diff --git
a/lib/parse.js
b/lib/parse.js
index
b061067
..
de982b1
100644
(file)
--- 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) {