Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: add debug CHECKs against empty handles #26125

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/api/callback.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ MaybeLocal<Value> InternalMakeCallback(Environment* env,
Local<Value> argv[],
async_context asyncContext) {
CHECK(!recv.IsEmpty());
#ifdef DEBUG
for (int i = 0; i < argc; i++)
CHECK(!argv[i].IsEmpty());
#endif

InternalCallbackScope scope(env, recv, asyncContext);
if (scope.Failed()) {
return MaybeLocal<Value>();
Expand Down
1 change: 1 addition & 0 deletions src/node_errors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ void DecorateErrorStack(Environment* env,
void FatalException(Isolate* isolate,
Local<Value> error,
Local<Message> message) {
CHECK(!error.IsEmpty());
HandleScope scope(isolate);

Environment* env = Environment::GetCurrent(isolate);
Expand Down