[英]Why does debuggers give you “undefined is not a function” instead of just telling you the name of the property/variable that is not a function?
What is the reason js debuggers gives you "undefined is not a function" instead of just telling you the name of the property/variable that is not a function? js调试器给您“未定义的不是函数”而不是仅仅告诉您不是函数的属性/变量的名称的原因是什么?
example: 例:
a = {
aFunction: function(){...}
notAFunction: "foo"
}
a.notAFunction()
Gives: 得到:
undefined is not a function 未定义不是函数
This is more helpful: 这更有用:
property "notAFunction" of object "a" is not a function 对象“ a”的属性“ notAFunction”不是函数
What are the exact obstacles? 确切的障碍是什么?
This is going to be changing very soon, it might already be in Canary too. 这将很快改变,它可能也已经在金丝雀中。
Improved exception messages: https://plus.google.com/+AddyOsmani/posts/DdWkiKsvbA2 改进的异常消息: https : //plus.google.com/+AddyOsmani/posts/DdWkiKsvbA2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.