Comment #3 on issue 865 by [email protected]: ES5: typeof for host
objects implementing [[Call]] should be function
http://code.google.com/p/v8/issues/detail?id=865
Short answer: It's a bug.
Longer answer: V8 creates optimized code for expressions like (typeof expr
== "string") that can be detected at compile time. The optimization
for "function" doesn't take RegExps into account, because originally they
weren't considered functions.
I'll add this to the bugs for callable RegExps.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev