0

First of all, I am just starting in JS and it is some sort of black magic to me so pardon me if my question is not relevant.

I have some object. I would like to convert calls to undefined functions into another function . For example, if funcUndef are undefined functions, I would like:

obj.funcUndef(param1, param2, param3, etc)

to be converted into:

obj.execute("funcUndef", "param1, param2, param3, etc");

Is it possible to intercept calls to undefined and execute my own function (which will be in charge of making the conversion and calling execute function)?

Korchkidu
  • 4,908
  • 8
  • 49
  • 69
  • 1
    i'm sorry but javascript does not have that facility. – Daniel A. White Aug 05 '14 at 14:07
  • This won't really be possible until [Proxies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) land, unless you want to call all functions through an intermediary function. – Matt Aug 05 '14 at 14:08

0 Answers0