(new RegExp).toString/toSource() now gives /(?:)/ instead of  // which is comments and does not work with uneval.
This commit is contained in:
igor%mir2.org 2003-11-24 15:51:44 +00:00
parent 5e69e857ce
commit 2997e9f7ee

View File

@ -201,7 +201,12 @@ public class NativeRegExp extends IdScriptable implements Function {
{
StringBuffer buf = new StringBuffer();
buf.append('/');
buf.append(re.source);
if (re.source.length != 0) {
buf.append(re.source);
} else {
// See bugzilla 226045
buf.append("(?:)");
}
buf.append('/');
if ((re.flags & JSREG_GLOB) != 0)
buf.append('g');