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 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
4 changes: 2 additions & 2 deletions src/node_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ class InternalCallbackScope {

class DebugSealHandleScope {
public:
explicit inline DebugSealHandleScope(v8::Isolate* isolate)
explicit inline DebugSealHandleScope(v8::Isolate* isolate = nullptr)
#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
Original file line number Diff line number Diff line change
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 seal_handle_scope;
return listener_->OnStreamAlloc(suggested_size);
}

void StreamResource::EmitRead(ssize_t nread, const uv_buf_t& buf) {
DebugSealHandleScope handle_scope(v8::Isolate::GetCurrent());
DebugSealHandleScope seal_handle_scope;
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 seal_handle_scope;
listener_->OnStreamAfterWrite(w, status);
}

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

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

Expand Down