【问题标题】:Nodejs: __call implementation available?Nodejs:__call 实现可用吗?
【发布时间】:2011-12-14 08:47:39
【问题描述】:

我至少需要这样的atm功能:

function ExampleClass() {
}

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

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

它还没有在 v8 中实现或以其他方式模拟吗?

有人在他们的项目中实现过这样的功能吗?

谢谢

【问题讨论】:

标签: javascript node.js v8


【解决方案1】:

StackOverflow上有一个类似的问题,你可以在那里找到答案:

Capture method missing in Javascript and do some logic?

【讨论】:

    猜你喜欢
    • 2012-08-07
    • 2017-12-17
    • 1970-01-01
    • 2013-06-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-18
    • 2016-08-30
    相关资源
    最近更新 更多