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: remove unnecessary Isolate::GetCurrent() calls #33298

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/node_internals.h
Expand Up @@ -245,7 +245,7 @@ class DebugSealHandleScope {
public:
explicit inline DebugSealHandleScope(v8::Isolate* isolate)
addaleax marked this conversation as resolved.
Show resolved Hide resolved
#ifdef DEBUG
: actual_scope_(isolate)
: actual_scope_(isolate != nullptr ? isolate : v8::Isolate::GetCurrent())
#endif
{}

Expand Down
10 changes: 5 additions & 5 deletions src/stream_base-inl.h
Expand Up @@ -92,29 +92,29 @@ void StreamResource::RemoveStreamListener(StreamListener* listener) {
}

uv_buf_t StreamResource::EmitAlloc(size_t suggested_size) {
DebugSealHandleScope handle_scope(v8::Isolate::GetCurrent());
DebugSealHandleScope handle_scope(nullptr);
return listener_->OnStreamAlloc(suggested_size);
}

void StreamResource::EmitRead(ssize_t nread, const uv_buf_t& buf) {
DebugSealHandleScope handle_scope(v8::Isolate::GetCurrent());
DebugSealHandleScope handle_scope(nullptr);
if (nread > 0)
bytes_read_ += static_cast<uint64_t>(nread);
listener_->OnStreamRead(nread, buf);
}

void StreamResource::EmitAfterWrite(WriteWrap* w, int status) {
DebugSealHandleScope handle_scope(v8::Isolate::GetCurrent());
DebugSealHandleScope handle_scope(nullptr);
listener_->OnStreamAfterWrite(w, status);
}

void StreamResource::EmitAfterShutdown(ShutdownWrap* w, int status) {
DebugSealHandleScope handle_scope(v8::Isolate::GetCurrent());
DebugSealHandleScope handle_scope(nullptr);
listener_->OnStreamAfterShutdown(w, status);
}

void StreamResource::EmitWantsWrite(size_t suggested_size) {
DebugSealHandleScope handle_scope(v8::Isolate::GetCurrent());
DebugSealHandleScope handle_scope(nullptr);
listener_->OnStreamWantsWrite(suggested_size);
}

Expand Down