"
An implementation may extend the ECMAScript Regular Expression grammar
defined in 21.2.1, but it must not extend the RegularExpressionBody and
RegularExpressionFlags productions defined below or the productions used by
these productions.
"
Why are implementations allowed to diverge on regular expressions this way?
Has any implementation ever used this ability to extend the grammar?
Does this mean that the source property of a regular expression isn't
guaranteed to return a same "length"ed string for every implementation?
Quoting the specification at
http://www.ecma-international.org/ecma-262/6.0/index.html#sec-literals-regular-expression-literals
:
"
An implementation may extend the ECMAScript Regular Expression grammar
defined in 21.2.1, but it must not extend the RegularExpressionBody and
RegularExpressionFlags productions defined below or the productions used by
these productions.
"
Why are implementations allowed to diverge on regular expressions this way?
Has any implementation ever used this ability to extend the grammar?
Does this mean that the source property of a regular expression isn't
guaranteed to return a same "length"ed string for every implementation?
Original discussion here:
https://github.com/benjamingr/RegExp.escape/issues/27
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150620/31cd9f6d/attachment.html>
Quoting the specification at www.ecma-international.org/ecma-262/6.0/index.html#sec-literals-regular-expression-literals :
" An implementation may extend the ECMAScript Regular Expression grammar defined in 21.2.1, but it must not extend the RegularExpressionBody and RegularExpressionFlags productions defined below or the productions used by these productions. "
Why are implementations allowed to diverge on regular expressions this way? Has any implementation ever used this ability to extend the grammar?
Does this mean that the source property of a regular expression isn't guaranteed to return a same "length"ed string for every implementation?
Original discussion here: benjamingr/RegExp.escape#27