分享

【原创】用chrome调试时出现的报错提示VM:数字是什么意思

 开启美好每一天 2015-11-16

用chrome调试一个 javascript 页面,调试时出现报错,但出错位置并没有像通常那样显示文件名:行号,而是显示vm:数字,这样就不知道到底是哪一行代码出现了问题,后来查找资料,在一个英文问答网站找到了答案。

It is abbreviation of the phrase Virtual Machine. In the Chrome JavaScript engine (called V8) each script has its own script ID.


Sometimes V8 has no information about the file name of a script, for example in the case of an eval. So devtools uses the text "VM" concatenated with the script ID as a title for these scripts.


Some sites may fetch many pieces of JavaScript code via XHR and eval it. If a developer wants to see the actual script name for these scripts she can use sourceURL. DevTools parses and uses it for titles, mapping etc.

简单的说就是在某些chrome的V8引擎下,某些报错项目不会显示具体文件名:行号,而是会显示VM(虚拟机的缩写):数字(脚本ID)。例如eval函数。

在我的页面里,就是eval语句少了分割用的逗号导致出错,修复后VM报错消失。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多