RESOLVED WONTFIX 71784
RegExp.prototype.compile should return the regular expression, rather than undefined.
https://bugs.webkit.org/show_bug.cgi?id=71784
Summary RegExp.prototype.compile should return the regular expression, rather than un...
Erik Corry
Reported 2011-11-08 01:50:32 PST
Attachments
Alexey Proskuryakov
Comment 1 2011-11-08 10:18:51 PST
Please post complete reports to Bugzilla. People reading bugs shouldn't need to click through to external sites. The bug report says: ------------------------------ var expr = (new RegExp).compile('str'); // now expr will be undefined The RegExp.prototype.compile function is non-standard. Mozilla have tried to remove it at least once: https://bugzilla.mozilla.org/show_bug.cgi?id=630284 That said, FF will return the regexp, while Safari and Chrome will return undefined.
Gavin Barraclough
Comment 2 2012-03-11 15:22:05 PDT
*** Bug 17822 has been marked as a duplicate of this bug. ***
Gavin Barraclough
Comment 3 2012-03-11 15:25:02 PDT
Our behavior matches Opera and Chrome, I haven't tested IE. Returning 'this' is not a common pattern in the JavaScript library, and doesn't seem appropriate here. I don't think we want to change, unless there is a strong web-compatibility case to do so.
Note You need to log in before you can comment on or make changes to this bug.