diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2021-02-08 17:13:37 +0300 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2021-02-19 14:08:06 +0300 |
commit | 8aa9b772f4892ab44e74d3e7df0733408b7d2bc8 (patch) | |
tree | 325563f3d49e086f75a0cdf9f4a9219c0734c443 /src/stream_base.cc | |
parent | 3c8290c5a8afd851f2521a507b375ca5c91ce87b (diff) |
bootstrap: include fs module into the builtin snapshot
PR-URL: https://github.com/nodejs/node/pull/36943
Fixes: https://github.com/nodejs/node/issues/35930
Refs: https://github.com/nodejs/node/issues/35711
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/stream_base.cc')
-rw-r--r-- | src/stream_base.cc | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/stream_base.cc b/src/stream_base.cc index 87781efb0e8..925dc3f152e 100644 --- a/src/stream_base.cc +++ b/src/stream_base.cc @@ -3,11 +3,12 @@ #include "stream_wrap.h" #include "allocated_buffer-inl.h" +#include "env-inl.h" +#include "js_stream.h" #include "node.h" #include "node_buffer.h" #include "node_errors.h" -#include "env-inl.h" -#include "js_stream.h" +#include "node_external_reference.h" #include "string_bytes.h" #include "util-inl.h" #include "v8.h" @@ -423,6 +424,29 @@ void StreamBase::AddMethods(Environment* env, Local<FunctionTemplate> t) { &Value::IsFunction>); } +void StreamBase::RegisterExternalReferences( + ExternalReferenceRegistry* registry) { + registry->Register(GetFD); + registry->Register(GetExternal); + registry->Register(GetBytesRead); + registry->Register(GetBytesWritten); + registry->Register(JSMethod<&StreamBase::ReadStartJS>); + registry->Register(JSMethod<&StreamBase::ReadStopJS>); + registry->Register(JSMethod<&StreamBase::Shutdown>); + registry->Register(JSMethod<&StreamBase::UseUserBuffer>); + registry->Register(JSMethod<&StreamBase::Writev>); + registry->Register(JSMethod<&StreamBase::WriteBuffer>); + registry->Register(JSMethod<&StreamBase::WriteString<ASCII>>); + registry->Register(JSMethod<&StreamBase::WriteString<UTF8>>); + registry->Register(JSMethod<&StreamBase::WriteString<UCS2>>); + registry->Register(JSMethod<&StreamBase::WriteString<LATIN1>>); + registry->Register( + BaseObject::InternalFieldGet<StreamBase::kOnReadFunctionField>); + registry->Register( + BaseObject::InternalFieldSet<StreamBase::kOnReadFunctionField, + &Value::IsFunction>); +} + void StreamBase::GetFD(const FunctionCallbackInfo<Value>& args) { // Mimic implementation of StreamBase::GetFD() and UDPWrap::GetFD(). StreamBase* wrap = StreamBase::FromObject(args.This().As<Object>()); |