|Summary:||WebKit doesn't support RegExp.compile method|
|Severity:||Enhancement||CC:||ap, darin, ddkilzer, steves_list|
|OS:||OS X 10.4|
Description evariste 2006-09-23 16:56:01 PDT
Comment 1 Alexey Proskuryakov 2007-10-30 10:48:30 PDT
Created attachment 16949 [details] proposed fix Maybe I'm missing something about this method, as I don't see any use for it - but tests do pass :)
Comment 2 Darin Adler 2007-10-30 11:09:45 PDT
Comment on attachment 16949 [details] proposed fix Seems fine. r=me We should figure out what good this is! And make tests that cover its value.
Comment 3 David Kilzer (:ddkilzer) 2007-10-30 11:38:44 PDT
Comment 4 Alexey Proskuryakov 2007-10-30 11:47:16 PDT
Comment 5 Darin Adler 2007-10-30 11:52:04 PDT
Comment 6 Steven Levithan 2007-10-30 12:54:44 PDT
Comment 7 Darin Adler 2007-10-30 13:08:49 PDT
If there are existing websites that use it, we probably should put the implementation in. Leaving it out of Safari, if it's in IE and Firefox, will more likely make them think Safari is broken rather than encouraging them to remove it.
Comment 8 Steven Levithan 2007-10-30 17:32:25 PDT
Yeah, I know that makes sense, but I hate to see meaningless cruft like this used by people who come from programming languages where compiling a regex can actually have significant performance impact. Actually, I can think of one thing that is different between using compile and just creating a new RegExp object. AFAIK, using compile on an existing regex will not discard custom properties on the object. However, I hope no one is relying on this feature (if I am in fact correct) since compile() has been deprecated for nearly a decade.
Comment 9 Alexey Proskuryakov 2007-10-31 01:46:15 PDT
Committed revision 27303. I don't know any sites that use RegExp.compile, but given that it is widely documented and implemented, I'm sure there are quite a few. > AFAIK, using compile on an existing regex will not discard > custom properties on the object. This is correct. Also, I can imagine situations where modifying an object leads to slightly nicer looking code than re-creating it. After all, compile() doesn't cause any architectural problems for anyone AFAICT, so I don't think we need to actively discourage it.
Comment 10 Geoffrey Garen 2007-11-06 13:31:53 PST
To add to what ap said above, his patch fixed an oft-duped compatibility problem with bmwusa.com.