【问题标题】:Mangled names in debugger with source maps带有源映射的调试器中的损坏名称
【发布时间】:2015-04-28 10:48:40
【问题描述】:

当使用由 grunt-contrib-uglify 生成的源映射时,Chrome/Safari 中的调试器不会显示未修改的变量名称。源代码显示和调试正确。我已经验证源映射包含变量名称。这是 uglify 的 bug 吗?

原文出处:

// two

function two()
{
    var test = "test";

    console.log("this is a " + test);
}

生成的来源:

function two(){var a="test";console.log("this is a "+a)}
//# sourceMappingURL=all.min.js.map

源图:

{
    "version": 3,
    "file": "all.min.js",
    "sources": ["../src/two.js"],
    "names": ["two","test","console","log"],
    "mappings":";;AAEA,QAASA,OAEL,GAAIC,GAAO,MAEXC,SAAQC,IAAI,aAAeF",
    "sourceRoot":"../"
}

【问题讨论】:

标签: javascript google-chrome debugging source-maps grunt-contrib-uglify


【解决方案1】:

如 @rd5 所述,这是 issue 327092 in Google Chrome,于 2013 年 12 月 9 日报告。

截至 2018 年 7 月 1 日,该问题仍未解决。

【讨论】:

猜你喜欢
  • 2020-02-12
  • 2017-04-08
  • 2018-12-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多