I think it would be more worthwhile of we tried to draw a compatibility boundary. Taking perlre as a baseline, for example, are there additional characters we should escape in `RegExp.escape` so that implementations (and the language itself) could add more perlre features without breaking compatibility? The `(?...)` syntax (and flags) seems to be the de facto extension point, can we protect that more narrowly? --scott On Jul 6, 2015 1:56 AM, "Benjamin Gruenbaum" <benjami...@gmail.com> wrote:
> 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. > > > > > [1] https://github.com/benjamingr/RegExp.escape > [2] > https://esdiscuss.org/topic/why-are-implementations-allowed-to-extend-the-regular-expressions-syntax > [3] > http://stackoverflow.com/questions/30958288/what-ecmascript-implementations-extend-the-regexp-syntax > > (*) some did it to implement ES2015 features before ES2015. > > _______________________________________________ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss