Forbid implementations from extending the RegExp grammar.

Benjamin Gruenbaum benjamingr at
Mon Jul 6 05:56:02 UTC 2015

So, following work on RegExp.escape [1] I found out that implementations
may extend the regular expression grammar in JavaScript [2]. However, when
asking esdiscuss and Stack Overflow about it [2][3] it doesn't look like
any implementations currently do so (*).

Can we please forbid implementations from extending the regular expression
syntax? It seems like this could cause compatibility issues between
implementations anyway. We have subclassable RegExp with hooks and symbols
in place and implementations that want to provide an extended RegExp can
subclass RegExp or propose an extension to the language itself.


(*) some did it to implement ES2015 features before ES2015.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list