Chrome似乎报错了行错误 [英] Chrome appears to report wrong line for error

查看:202
本文介绍了Chrome似乎报错了行错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在第975行出现错误(这是控制台报告),但是当我看代码时,显然不是975。

I'm getting an error on line 975 ( this is what the console reports ), but when I look at the code it is clearly not 975.

不能读取未定义的属性E:

Cannot read property E of undefined:

这是一个截图:

Here is a screenshot:

以下是截图,显示...的差异。

Here is the screenshot showing the disparity for ...

推荐答案

Chrome可能没有报告具体的行,但是使用第975行作为代码的段落的引用,其中没有找到属性E,因此第975行可能在任何代码都有问题(一些调试器这样做而不是报告第一行他们发现问题 - 也许Chrome的解释器这样工作,我不知道,因为我使用Firefox进行开发)。在这种情况下,这意味着这个是没有定义的,有你的问题。

It's possible Chrome isn't reporting the specific line, but using line 975 as a reference to the segment of the code where property E doesn't seem to be found, thus line 975 could be in the middle of whatever code is problematic (some debuggers do this instead of reporting the first line they find a problem on - maybe Chrome's interpreter works like this, I don't know though, since I use Firefox for development instead). In that case, it would mean that this is what's undefined and there's your problem.

我们必须查看更多以了解为什么会发生这种情况,因为我们无法确定这个的上下文来自截图。这个的期望值是什么,如果这是稍后实例化的对象定义的一部分,那么您如何实例化它,因为上下文对于这个

We'd have to see more to get a grip on why this would be happening since we can't determine what the context for this is from the screenshot. What is the expected value of this and if this is part of an object definition that you instantiate later, how do you instantiate it, as the context could matter for the value of this.

这篇关于Chrome似乎报错了行错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆