Based on ideas in js-async-init, this optimises the stack trace slicing to use indexOf rather than splitting and joining. Also the check for captureStackTrace and stackTraceLimit is now done statically.
I've also mocked out the console.error and process.stderr.write so that way we don't get weird looking messages when running tests.
Description
Based on ideas in js-async-init, this optimises the stack trace slicing to use
indexOf
rather than splitting and joining. Also the check forcaptureStackTrace
andstackTraceLimit
is now done statically.I've also mocked out the
console.error
andprocess.stderr.write
so that way we don't get weird looking messages when running tests.Final checklist