使用chrome中的以下代码
try {
throw new Error( "Error!" );
} catch(e) {
console.log(e.name);
console.log(e.message);
console.log(e.stack);
}
我在控制台
中得到以下内容Error: Error!
at HTMLButtonElement.<anonymous> (file:///sample/platforms/ios/www/js/app.js:58:22)
at HTMLButtonElement.f.event.dispatch (file://sample/platforms/ios/www/js/jquery.min.js:3:4816)
at HTMLButtonElement.h.handle.i (file://sample/platforms/ios/www/js/jquery.min.js:3:716)
但是,当我使用PhoneGap构建时,我会得到类似这样的内容
@file://Library/Application%20Support/iPhone%20Simulator/6.1/Applications/29A502DF-F664-434A-94C6-12AAA20BCF33/HelloWorld.app/www/js/app.js:53
dispatch@file:///Library/Application%20Support/iPhone%20Simulator/6.1/Applications/29A502DF-F664-434A-94C6-12AAA20BCF33/HelloWorld.app/www/js/jquery.min.js:3
i@file:///Library/Application%20Support/iPhone%20Simulator/6.1/Applications/29A502DF-F664-434A-94C6-12AAA20BCF33/HelloWorld.app/www/js/jquery.min.js:3
我想知道我是否有可能获得第一个堆栈跟踪,或者PhoneGap是否只是搞砸了异常消息。谢谢!
答案 0 :(得分:2)
我明白了。我在浏览器中使用v8(chrome&#j; javascript引擎),而phonegap使用本机引擎(webkit)