Felix Böhm wrote:
It seems like somebody thought about this use case when adding the
second argument.
Yes, shaver and I talked about this way back when he added the array
extras -- we wanted an optional |this| parameter for the callback.
Invokable RegExps would have been a solution, although nobody would
expect a RegExp to be invokable (because it's pretty exotic) and it
probably wouldn't have been used anyways by a lot of people.
You'd be surpised -- callable regexps were in SpiderMonkey for ages and
other implementations copied.
But ES3 forbids any native object other than "function" (native meaning
a built-in defined by ES3) from having [[Call]], and typeof x ==
"function" implies for a native object denoted x that x is in fact a
Function instance.
Anyway, sounds like you're ok with the optional trailing |this| parameter.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss