summaryrefslogtreecommitdiff
path: root/src/js_stream.cc
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2017-08-18 22:37:37 -0700
committerJames M Snell <jasnell@gmail.com>2017-08-23 10:35:34 -0700
commit5e7c69716ecbb7a0ebceaed7cc1c6847f9bc5058 (patch)
treee46aa77686c39196f93a4bf064ca0282188fb67e /src/js_stream.cc
parent771a03dfe3dba6ac3136bd4aa25525220e29b0ff (diff)
downloadnode-new-5e7c69716ecbb7a0ebceaed7cc1c6847f9bc5058.tar.gz
src: reduce code duplication
Adds `AsyncWrap::AddWrapMethods()` to add common methods to a `Local<FunctionTemplate>`. Follows same pattern as stream base. PR-URL: https://github.com/nodejs/node/pull/14937 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/js_stream.cc')
-rw-r--r--src/js_stream.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/js_stream.cc b/src/js_stream.cc
index caef92f1ca..2e7f082e28 100644
--- a/src/js_stream.cc
+++ b/src/js_stream.cc
@@ -218,7 +218,7 @@ void JSStream::Initialize(Local<Object> target,
t->SetClassName(jsStreamString);
t->InstanceTemplate()->SetInternalFieldCount(1);
- env->SetProtoMethod(t, "getAsyncId", AsyncWrap::GetAsyncId);
+ AsyncWrap::AddWrapMethods(env, t);
env->SetProtoMethod(t, "doAlloc", DoAlloc);
env->SetProtoMethod(t, "doRead", DoRead);