mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
757f3f8b2c
Previously, we call the JS land `runNextTicks` implementation immediately from JS land after evaluating the main module or the input, so these synchronous JS call frames would show up in the stack trace of the async errors, which can be confusing. This patch moves those calls into C++ so that more of these internal scheduler implementation details can be hidden and the users can see a cleaner a cleaner async JS stack trace. PR-URL: https://github.com/nodejs/node/pull/27392 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
28 lines
327 B
JavaScript
28 lines
327 B
JavaScript
'use strict';
|
|
|
|
async function one() {
|
|
throw new Error('test');
|
|
}
|
|
|
|
async function breaker() {
|
|
return true;
|
|
}
|
|
|
|
async function stack() {
|
|
await breaker();
|
|
}
|
|
|
|
async function two() {
|
|
await stack();
|
|
await one();
|
|
}
|
|
async function three() {
|
|
await two();
|
|
}
|
|
|
|
async function four() {
|
|
await three();
|
|
}
|
|
|
|
module.exports = four;
|