Chrome Development Tool: [VM] file from javascript

Chrome Development Tool: [VM] file from javascript

[VM] (scriptId) has no special meaning. It's a dummy name假名 to help us to distinguish code which are not directly tied to a file name, such as code created using eval and friends.

In the past, all of these scripts were just labelled (program).

If you're interested, just look up "[VM]"in the source code of Chromium, you will discover that these numbers have no significant meaning outside the developer tools.

update 2015-06-25

[VM] (scriptId) was renamed to VMscriptId a while ago, and here is the direct link to search result in case the value changes again.

 

 

 

Chrome Console: 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.

 

https://blog.csdn.net/u010598271/article/details/53740778

chrome下调试本地js,不能设置断点,在控制台显示VM+数字+要调试的文件名。

解决方案:

1》、在调试<source>的左下方有一个{}图标,提示“pretty print”,点击,chrome就会另外打开一个:formatted的文件,在里面就可以调试了。

原因估计是chrome将源文件误认为是压缩过的,所以不能断点调试,重新格式化下就行了。

2》、清空缓存或重启浏览器

 

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(477)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2017-07-17 常用快捷键
2017-07-17 Track Active Item in Solution Explorer
2015-07-17 Learning WCF Chapter2 Service Contracts
2015-07-17 Learning WCF Chapter2 WCF Contracts and Serialization
2015-07-17 Learning WCF Chapter2 Service Description
2015-07-17 Learning WCF Chapter2 Messaging Protocols
2015-07-17 Learning WCF Chapter1 Summary
点击右上角即可分享
微信分享提示