Search code examples
javascriptnode.jsv8

Nodejs: __call implementation available?


I need at least such feature atm:

function ExampleClass() {
}

ExampleClass.prototype.__noSuchMethod__ = function() {
  console.log("No such method, maybe you should try reading the docs?");
}

example = new ExampleClass();
example.eatPizza();

Isn't it implemented yet in v8 or anyhow emulated else?

Have anyone implemented such feature on their projects?

Thanks


Solution

  • There was a similar question on StackOverflow, you can find the answer there:

    Capture method missing in Javascript and do some logic?