mirror of
https://github.com/swc-project/swc.git
synced 2024-12-22 21:21:31 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
13 lines
476 B
TypeScript
13 lines
476 B
TypeScript
// Loaded from https://raw.githubusercontent.com/denjucks/dex/master/lib/util/save-async-stack.js
|
|
|
|
|
|
export default function saveAsyncStack(instance, lines) {
|
|
if (instance.client.config.asyncStackTraces) {
|
|
// a hack to get a callstack into the client code despite this
|
|
// node.js bug https://github.com/nodejs/node/issues/11865
|
|
const stackByLines = new Error().stack.split('\n');
|
|
stackByLines.splice(0, lines);
|
|
instance._asyncStack = stackByLines;
|
|
}
|
|
};
|