diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-09-23 19:24:33 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-10-03 13:43:42 -0700 |
commit | d527dde3600655eae7ce0ba5da9263ec4560cd11 (patch) | |
tree | cb9186b8b85a696ec7f916f40fcec935ba86fdc9 /src/node_worker.cc | |
parent | 2ebdba12297348649620e3d302b156c149d85a6e (diff) | |
download | node-new-d527dde3600655eae7ce0ba5da9263ec4560cd11.tar.gz |
src: use JS inheritance for `AsyncWrap`
For all classes descending from `AsyncWrap`, use JS inheritance
instead of manually adding methods to the individual classes.
This allows cleanup of some code around transferring handles
over IPC.
PR-URL: https://github.com/nodejs/node/pull/23094
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_worker.cc')
-rw-r--r-- | src/node_worker.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_worker.cc b/src/node_worker.cc index aee97095a4..63d89a966d 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -482,8 +482,8 @@ void InitWorker(Local<Object> target, Local<FunctionTemplate> w = env->NewFunctionTemplate(Worker::New); w->InstanceTemplate()->SetInternalFieldCount(1); + w->Inherit(AsyncWrap::GetConstructorTemplate(env)); - AsyncWrap::AddWrapMethods(env, w); env->SetProtoMethod(w, "startThread", Worker::StartThread); env->SetProtoMethod(w, "stopThread", Worker::StopThread); env->SetProtoMethod(w, "ref", Worker::Ref); |