Bug 22082

Summary: typeof should return "object" for RegExps instead of "function"
Product: WebKit Reporter: Maciej Stachowiak <mjs>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WORKSFORME    
Severity: Normal CC: barraclough, gavin.sharp, raingrove, zwarich
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   

Description Maciej Stachowiak 2008-11-05 06:53:48 PST
JavaScriptCore supports a longstanding Mozilla extension whereby RegExps are callable. Mozilla decided that despite this typeof should return "object" on RegExps, otherwise too much other code breaks or gets confused. This is also proposed as a change for ES3.1. Since Mozilla has already made this change, and since it would match the typeof return from IE and Opera, we should likely make this change.

In the future we could also consider removing the callable regexp extension, since it's not clear if it is needed for Web compatibility and so would let us remove a strange quirk.
Comment 1 Cameron Zwarich (cpst) 2009-03-20 08:18:07 PDT
*** Bug 24716 has been marked as a duplicate of this bug. ***
Comment 2 Gavin Barraclough 2011-10-03 13:49:21 PDT
This works for me in ToT
Comment 3 Alexey Proskuryakov 2011-10-04 10:03:40 PDT
Presumably fixed via bug 28285.