断点调试最小化/损坏/编译变量

编程入门 行业动态 更新时间:2024-10-09 10:27:36
本文介绍了断点调试最小化/损坏/编译变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

更多推荐

断点调试最小化/损坏/编译变量

本文发布于:2023-11-23 22:13:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1623006.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:最小化   断点   变量

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!