archives

« Bugzilla Issues Index

#2609 — `RegExp.prototype.toString()`


As discussed during the Apr 9 meeting, specifying `RegExp.prototype.toString` completely is a can of worms, and we should leave it up to implementations.

Waldemar suggested the spec should add a requirement that makes `eval(RegExp(string))` hold true for all values of string (browsers get this wrong).


Requirement could go something among the lines of:

> The result of `RegExp.prototype.toString`, when called on a regular expression object, should be usable as a regular expression literal.


this is already covered in much more detail within
21.2.3.3.4 EscapeRegExpPattern