Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions src/stream_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ void StreamBase::AddMethods(Environment* env, Local<FunctionTemplate> t) {

void StreamBase::RegisterExternalReferences(
ExternalReferenceRegistry* registry) {
static bool is_registered = false;
if (is_registered) return;
registry->Register(GetFD);
registry->Register(GetExternal);
registry->Register(GetBytesRead);
Expand All @@ -471,6 +473,7 @@ void StreamBase::RegisterExternalReferences(
registry->Register(
BaseObject::InternalFieldSet<StreamBase::kOnReadFunctionField,
&Value::IsFunction>);
is_registered = true;
}

void StreamBase::GetFD(const FunctionCallbackInfo<Value>& args) {
Expand Down
3 changes: 1 addition & 2 deletions src/stream_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ void LibuvStreamWrap::RegisterExternalReferences(
registry->Register(IsConstructCallCallback);
registry->Register(GetWriteQueueSize);
registry->Register(SetBlocking);
// TODO(joyee): StreamBase::RegisterExternalReferences() is called somewhere
// else but we may want to do it here too and guard it with a static flag.
StreamBase::RegisterExternalReferences(registry);
}

LibuvStreamWrap::LibuvStreamWrap(Environment* env,
Expand Down