Javascript chrome错误不存在';如果承诺被拒绝和捕获,则无法解析源映射
当我的承诺被拒绝时,我无法让chrome解析我的sourcemap。 在我的代码中,我打印一个值,然后故意使我的承诺失败:Javascript chrome错误不存在';如果承诺被拒绝和捕获,则无法解析源映射,javascript,google-chrome,google-chrome-devtools,source-maps,es6-promise,Javascript,Google Chrome,Google Chrome Devtools,Source Maps,Es6 Promise,当我的承诺被拒绝时,我无法让chrome解析我的sourcemap。 在我的代码中,我打印一个值,然后故意使我的承诺失败: ... window.console.log(this); return this._foo.bar; ... log(这个)正确解析为models.stack.js:325 错误不会解析为models.stack.js,而是解析为绑定的代码(geometrics\u slice.js) 承诺电话: Promise .all(loadSequence) .then(
...
window.console.log(this);
return this._foo.bar;
...
- log(这个)正确解析为models.stack.js:325
- 错误不会解析为models.stack.js,而是解析为绑定的代码(geometrics\u slice.js)
Promise
.all(loadSequence)
.then(function() {
// this part of the code will call
//
// ...
// window.console.log(this);
// return this._foo.bar
// ...
//
// at some point in models.stack.js
let series = seriesContainer[0].mergeSeries(seriesContainer)[0];
})
.catch(function(error) {
window.console.log('oops... something went wrong...');
window.console.log(error);
});
如果未捕获错误:
Promise
.all(loadSequence)
.then(function() {
let series = seriesContainer[0].mergeSeries(seriesContainer)[0];
})
然后正确映射错误
这是预期的行为吗?请在代码中包含承诺部分好吗?这听起来像个bug。你试过报告它吗?@Bergi请看编辑-我还没有报告它,因为我只是注意到它,并想确定它实际上是一个bug。实际上,可能这是预期的行为,但最好将其映射回原始源。