I meant something like `RegExp.escape(str, "☺")` (also escapes `☺`). Since strings are iterable by code points via the new iteration protocol this sounds like the natural choice. I'm not sure such a second argument would be a good idea.
On Mon, Jun 29, 2015 at 9:42 PM, C. Scott Ananian <ecmascr...@cscott.net> wrote: > Please, not an iterable over characters. (Or at least, "not only".) Use a > RegExp. Imagine trying to ensure that any characters over \u007f were > escaped. You don't want an iterable over ~64k characters. > > In addition, a RegExp would allow you to concisely specify "hex digits, > but only at the start of the string" and some of the other oddities we've > considered. > --scott > >
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss