On Mar 23, 2012, at 11:45 AM, Roger Andrews wrote: > Concerning UTF-16 surrogate pairs, how about a function like: > String.isValid( str ) > to discover whether surrogates are used correctly in 'str'? > > Something like Array.isArray().
No need for it to be a class method, since it only operates on strings. We could simply have String.prototype.isValid(). Note that it would work for primitive strings as well, thanks to JS's automatic promotion semantics. Dave _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

