/\1/ could be a valid RegExp through Chapter 16 Extension clause?

Allen Wirfs-Brock allen at wirfs-brock.com
Wed Jul 6 17:10:36 PDT 2011

On Jul 6, 2011, at 4:35 PM, Dave Fugate wrote:

>                 var x = /\1/;
> According to, the RegExp snippet above should throw something as there aren’t any capturing parenthesis within the RegExp, yet one is referenced.  Just now noticed that step 4 of is more precise and shows a SyntaxError gets thrown.  Isn’t the snippet then potentially valid ES5 code through Chapter 16’s SyntaxError extension clause?

It isn't valid ES5 code but it valid as an implementation defined extension to ES5.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110706/f709c2b8/attachment.html>

More information about the es-discuss mailing list