我至少需要这样的功能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中实现或无论如何模拟其他?
有没有人在他们的项目中实现过这样的功能?
谢谢
答案 0 :(得分:2)
StackOverflow上有类似的问题,你可以在那里找到答案: