Chrome Typescript调试引用错误'this'
问题描述:
有时,当我在Chrome开发者工具中点击一个断点时,TypeScript 这个
实际上是JavaScript中的 _this
。我必须在控制台中手动放入 _this
,看看实际使用的是什么。有没有办法来解决这个问题?
Sometimes when I hit a breakpoint in the Chrome Developer Tools, the TypeScript this
is actually _this
in the JavaScript. I have to manually put _this
in the console to see what is actually being used. Is there a way to fix this?
答
TypeScript这实际上是这个JavaScript的
the TypeScript this is actually _this in the JavaScript
这是源码图中的一个错误。您可以在此处跟踪: https://github.com/Microsoft/TypeScript/issues/2859
This is due to a bug in the sourcemaps. You can track it here : https://github.com/Microsoft/TypeScript/issues/2859