promise: better stack traces for --trace-warnings
Checklist
-
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
promises
Description of change
Give better stack traces for PromiseRejectionHandledWarning
and UnhandledPromiseRejectionWarning
s.
For PromiseRejectionHandledWarning
, when it is likely that there is an Error
object generated, it is created early to provide a proper stack trace.
For UnhandledPromiseRejectionWarning
, the stack trace of the
underlying error object is used, if possible.