Skip to content

Commit

Permalink
fixup! add comment to handleErrorFromBinding
Browse files Browse the repository at this point in the history
Co-authored-by: Joyee Cheung <[email protected]>
  • Loading branch information
sapphi-red and joyeecheung committed Oct 12, 2023
1 parent 92016f0 commit 984d81c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/internal/fs/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ function lazyFsStreams() {
return fsStreams ??= require('internal/fs/streams');
}

// By the time the C++ land creates an error for a promise rejection (likely from a
// libuv callback), there is already no JS frames on the stack. So we need to
// wait until V8 resumes execution back to JS land before we have enough information
// to re-capture the stack trace.
function handleErrorFromBinding(error) {
ErrorCaptureStackTrace(error, handleErrorFromBinding);
return PromiseReject(error);
Expand Down

0 comments on commit 984d81c

Please sign in to comment.