Skip to content

Commit

Permalink
Merge pull request mishoo#211 from lautis/unicode-whitespace
Browse files Browse the repository at this point in the history
Recognize various Unicode whitespace
  • Loading branch information
mishoo committed Sep 20, 2011
2 parents 0bb798b + 6d79555 commit e57aadc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parse-js.js
Expand Up @@ -189,7 +189,7 @@ var OPERATORS = array_to_hash([
"||"
]);

var WHITESPACE_CHARS = array_to_hash(characters(" \u00a0\n\r\t\f\u000b\u200b"));
var WHITESPACE_CHARS = array_to_hash(characters(" \u00a0\n\r\t\f\u000b\u200b\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000"));

var PUNC_BEFORE_EXPRESSION = array_to_hash(characters("[{}(,.;:"));

Expand Down
1 change: 1 addition & 0 deletions test/unit/compress/expected/whitespace.js
@@ -0,0 +1 @@
function id(a){return a}
21 changes: 21 additions & 0 deletions test/unit/compress/test/whitespace.js
@@ -0,0 +1,21 @@
function id(a) {
// Form-Feed
// Vertical Tab
// No-Break Space
// Mongolian Vowel Separator
// En quad
// Em quad
// En space
// Em space
// Three-Per-Em Space
// Four-Per-Em Space
// Six-Per-Em Space
// Figure Space
// Punctuation Space
// Thin Space
// Hair Space
// Narrow No-Break Space
// Medium Mathematical Space
 // Ideographic Space
return a;
}

0 comments on commit e57aadc

Please sign in to comment.