Strawman: Function.observe

Michał Wadas michalwadas at
Sun Sep 28 11:34:31 PDT 2014

We have Object.observe (asynchronous callback whenever object
properties changes), but do we need Function.observe (asynchronous
callback whenever function is called)?

- can prevent many optimizations (but Object.observe too)

- allows easy debugging and profiling
- allows extending libraries functionalities without modyfing their
code (widgets?)

What should be eventually received by callback code? Possible options:
- arguments (can prevent certain optimizations; critical for debugging
and  profiling)
- caller
- callee
- function's execution time
- thisArg of observed function (critical for observing methods of prototype)

More information about the es-discuss mailing list