Great proposal, Norbert!

Another tool that uses JavaScript to identify identifiers as per ECMAScript 5.1 
/ Unicode 6.2 is http://mothereff.in/js-variables.

For a list of bug reports regarding identifier handling in browsers / 
JavaScript engines, see http://mathiasbynens.be/notes/javascript-identifiers 
(look for “Some of these don’t work in all browsers/environments”).

I’m a bit confused by step 7.2, though: “If edition is not 3, 5, or 6, throw a 
RangeError exception.” Does this mean only integers are accepted? E.g. you can 
specify `5` as the ECMAScript version, but not `5.1`? I would suggest adding 
`5.1` to the list (even if it’s just an alias to `5`), but perhaps I’m missing 
something.

Also, how about adding `String.isIdentifier(string)` as well?

On 12 Mar 2013, at 02:45, Norbert Lindenberg 
<ecmascr...@lindenbergsoftware.com> wrote:

> So, rather than having one grand unified character classification API with 
> support for both Unicode versions and regular expressions I think it's better 
> to provide tailored APIs for different purposes.

+1

> - For general Unicode processing, I think it's important to have support in 
> regular expressions, because that's what many applications use for text 
> processing. For tools operating on ECMAScript source code that seems less 
> important, based on the data I collected [3].

Agreed it would be nice. In the meantime, to polyfill this functionality, tools 
that take a list of code points / symbols / ranges (like 
http://mths.be/regenerate) could be used.

Regards,
Mathias

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to