Bug 22082
Summary: | typeof should return "object" for RegExps instead of "function" | ||
---|---|---|---|
Product: | WebKit | Reporter: | Maciej Stachowiak <mjs> |
Component: | JavaScriptCore | Assignee: | 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 |
Maciej Stachowiak
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Cameron Zwarich (cpst)
*** Bug 24716 has been marked as a duplicate of this bug. ***
Gavin Barraclough
This works for me in ToT
Alexey Proskuryakov
Presumably fixed via bug 28285.