Identifying ECMAScript identifiers

gaz Heyes gazheyes at
Sat Mar 9 02:55:17 PST 2013

On 9 March 2013 01:59, Ariya Hidayat <ariya.hidayat at> wrote:

> If you check Yusuke's links, that is exactly what Esprima is doing.
> The use of regular expression is reserved only for the slow/uncommon
> code path.

Yeah I can see you are converting a char code into a string using
fromCharCode and comparing it against a regex which is slower and I showed
you a function that checks non-alpha variables using charcodes. BTW your
isWhiteSpace function also calls to functions indexOf/fromCharcode when it
doesn't need to and also indexOf starts at 0 so you have to check if it's
greater than -1.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list