admin管理员组文章数量:1317906
We're experimenting with using --harmony_async_await
in Node 7, and pared to transpiling with babel for async/await are missing the ability to have long stack traces (.longstacktraces.html).
Obviously, it would be great if there was an option to 'just see this' - on the chrome(ium) side they appear to support it in the inspector, though the latest work on this is after v8.5.4 (i.e. not in Node 7):
/
An alternative approach would be to get v8 to use bluebird's promise implementation - but how could I do that? Overriding global. Promise
doesn't change how async/await behave (they still use the default promises).
We're experimenting with using --harmony_async_await
in Node 7, and pared to transpiling with babel for async/await are missing the ability to have long stack traces (http://bluebirdjs./docs/api/promise.longstacktraces.html).
Obviously, it would be great if there was an option to 'just see this' - on the chrome(ium) side they appear to support it in the inspector, though the latest work on this is after v8.5.4 (i.e. not in Node 7):
https://bugs.chromium/p/v8/issues/detail?id=4483
https://codereview.chromium/2357423002/
An alternative approach would be to get v8 to use bluebird's promise implementation - but how could I do that? Overriding global. Promise
doesn't change how async/await behave (they still use the default promises).
- Interestingly, Emanuel Jöbstl suggests that replacing the built-in promise implementation which you mention actually works! medium./front-end-weekly/…. – kresho Commented Feb 1, 2019 at 14:50
- 3 Replacing the promise implementation to bluebird and enabling full stack traces incurs a high performance hit 4x-5x (github./nodejs/node/issues/11865#issuement-325035479) – kresho Commented Feb 1, 2019 at 15:32
- 10 But node 12 finally provides native support - docs.google./document/d/… – kresho Commented Feb 1, 2019 at 15:33
- 1 @kresho thanks for letting me (and everyone else) know! Perhaps something changed since I'd messed with it, or I just made a mistake. Node/v8 have certainly e a long way since this question was asked. – james.haggerty Commented May 19, 2019 at 9:43
- 7 Question was from 2016 :) – james.haggerty Commented Nov 20, 2019 at 2:31
1 Answer
Reset to default 1Since NodeJS v12 async stack traces are enabled by default.
relevant issue
how async stacktraces work
本文标签:
版权声明:本文标题:javascript - Is it possible to get stack traces across asyncawait boundaries using --harmony_async_await in Node 7? - Stack Over 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742032652a2416740.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论