Skip to content

Commit

Permalink
Recognize identifier characters from the Supplementary Multilingual P…
Browse files Browse the repository at this point in the history
…lane.

Fixes jquery#1244.
  • Loading branch information
ariya committed Jul 28, 2015
1 parent 82e5030 commit f4e760b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions esprima.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@
String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023));
}

function fromCodePoint(cp) {
return (cp < 0x10000) ? String.fromCharCode(cp) :
String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) +
String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023));
}

function isIdentifierStart(ch) {
return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)
(ch >= 0x41 && ch <= 0x5A) || // A..Z
Expand Down

0 comments on commit f4e760b

Please sign in to comment.