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).

Share Improve this question edited Jan 15, 2021 at 18:55 Zac Anger 7,7872 gold badges20 silver badges46 bronze badges asked Nov 18, 2016 at 6:41 james.haggertyjames.haggerty 1,1806 silver badges10 bronze badges 6
  • 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
 |  Show 1 more ment

1 Answer 1

Reset to default 1

Since NodeJS v12 async stack traces are enabled by default.

  • relevant issue

  • how async stacktraces work

本文标签: