On 6 March 2012 05:35, Biju <[email protected]> wrote:

> So I have proposal, can we have 3rd parameter for replace() function?
> like
>
> haystack.replace(needle, newText, regexpFlag);
>
> where regexpFlag is the flag part of the RegExp.
> And if "needle" is a string will be used to make the match characters
> after "escaping" special characters like *?.()[]{}\^$|/
>

No no no no nooooooooooooooooo. This is already one of the best functions
in JavaScript but has been really badly designed. This suggestion makes it
worse.

<
http://www.thespanner.co.uk/2010/09/27/string-replace-javascript-bad-design/>


Even Twitter devs seemed to struggle with using it correctly to fix a DOM
xss issue.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to