[英]Nodejs: __call implementation available?
I need at least such feature atm: 我至少需要这样的功能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? 它不是在v8中实现还是以其他方式仿真?
Have anyone implemented such feature on their projects? 有人在他们的项目中实现了这种功能吗?
Thanks 谢谢
There was a similar question on StackOverflow, you can find the answer there: StackOverflow上也有类似的问题,您可以在此处找到答案:
Capture method missing in Javascript and do some logic? 捕获Javascript中缺少的方法并执行一些逻辑?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.