diff options
author | Jon Moss <me@jonathanmoss.me> | 2018-12-18 23:52:09 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-03-08 11:25:30 +0300 |
commit | 4697e1b0d792f50863bbbcad25a95b84e6746501 (patch) | |
tree | ec352361e56956176ca5831c092703d36cd929c6 /src/node_file.cc | |
parent | 254635198ab1e6afed357c1884c1ef75eb3b8486 (diff) |
src: remove templating from StreamBase
PR-URL: https://github.com/nodejs/node/pull/25142
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_file.cc')
-rw-r--r-- | src/node_file.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/node_file.cc b/src/node_file.cc index dd658e2ecf0..f4106ce6477 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -111,6 +111,7 @@ FileHandle::FileHandle(Environment* env, Local<Object> obj, int fd) StreamBase(env), fd_(fd) { MakeWeak(); + StreamBase::AttachToObject(GetObject()); } FileHandle* FileHandle::New(Environment* env, int fd, Local<Object> obj) { @@ -2227,11 +2228,11 @@ void Initialize(Local<Object> target, env->SetProtoMethod(fd, "close", FileHandle::Close); env->SetProtoMethod(fd, "releaseFD", FileHandle::ReleaseFD); Local<ObjectTemplate> fdt = fd->InstanceTemplate(); - fdt->SetInternalFieldCount(1); + fdt->SetInternalFieldCount(StreamBase::kStreamBaseField + 1); Local<String> handleString = FIXED_ONE_BYTE_STRING(isolate, "FileHandle"); fd->SetClassName(handleString); - StreamBase::AddMethods<FileHandle>(env, fd); + StreamBase::AddMethods(env, fd); target ->Set(context, handleString, fd->GetFunction(env->context()).ToLocalChecked()) |