ES4 draft: Function

Garrett Smith dhtmlkitchen at
Thu Mar 13 19:05:40 PDT 2008

It seems to me that a function is a callable object, not the other way
around. As if a Function were an implementation of Callable, where
callable was an interface.

For programs to be concerned more with the object's capability -- what
it can do -- not who constructed it.

Considering how that would affect the toString method:
"The intrinsic toString method converts the executable code of the
function to a string representation"

Some objects are callable, but the source code isn't avaiable. Object
such as window.addEventListener, in a modern browser.

This implementation of toString, quoted above, would be appropriate
for Function, but not necessarily all Callable objects, such as
window.alert in a browser:-

javascript:void(, window, alert));


2008/3/10 Lars Hansen <lhansen at>:
> First draft of the spec for the Function class.  Please comment.
>  --lars
> _______________________________________________
>  Es4-discuss mailing list
>  Es4-discuss at

More information about the Es4-discuss mailing list