断点调试最小化/损坏/编译变量 [英] Breakpoint debugging minfied/mangled/compiled variables

查看:114
本文介绍了断点调试最小化/损坏/编译变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

致力于将JavaScript源代码构建到我的工作流程中,并且一直在寻找关于调试源地图特定部分的一些文档。在下面的图片中,我运行的是压缩的Javascript代码,但通过源映射的魔力,Chrome调试器能够重构看似未压缩的代码,供我调试: img src =https://i.stack.imgur.com/UFYyc.pngalt =来源地图>



但是,如果你看看本地变量, someNumber someOtherNumber 未定义。相反,我们有 a r ,这是该函数的已编译变量名称。这对于Mozilla Firefox和Chrome都是一样的。



我试着浏览 Chrome开发工具文档,但我没有看到任何关于此的文章。它是源代码调试的当前局限性吗?是否有任何解决方法?

更新

自从找到此主题铬项目问题。它看起来并不像或正在实施。随着团队开始在构建系统中实现Babel来编写ES2015代码,这变得越来越重要。有任何团队找到解决办法吗?

解决方案

看起来已经解决并且可以使用在下一次Chromium更新中


Working on building JavaScript sourcemaps into my workflow and I've been looking for some documentation on a particular part of debugging source maps. In the picture below I'm running compressed Javascript code, but through the magic of source maps Chrome debugger was able to reconstruct the seemingly uncompressed code for me to debug:

However, if you look at the local variables, someNumber and someOtherNumber are not defined. Instead, we have a and r, which are the compiled variable names for this function. This is the same for both Mozilla Firefox and Chrome.

I tried looking through the Chrome DevTools Documentation on sourcemaps, but I didn't see anything written about this. Is it a current limitation of sourcemap debugging and are there any workarounds for this?

update:

I've since found this thread in chromium project issues. It doesn't look like it has been or is being implemented. This is becoming an increasingly more important problem as teams are beginning to implement Babel in their build systems to write ES2015 code. Have any teams found a way around this?

解决方案

Looks like it's been addressed and will become available in the next Chromium update

这篇关于断点调试最小化/损坏/编译变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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