summaryrefslogtreecommitdiff
path: root/src/node_serdes.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-04-08 17:14:00 +0200
committerShelley Vohr <shelley.vohr@gmail.com>2020-06-30 09:34:19 -0700
commitf50febc73c9c978c23178fd123d58d1b08e66979 (patch)
treed1e23e873b195b3f0f8b785fc673ed295c002a66 /src/node_serdes.cc
parent7fdb507ec156b03e41be498d3b5eba314cba369f (diff)
downloadnode-new-f50febc73c9c978c23178fd123d58d1b08e66979.tar.gz
src: introduce BaseObject base FunctionTemplate
PR-URL: https://github.com/nodejs/node/pull/33772 Backport-PR-URL: https://github.com/nodejs/node/pull/33965 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'src/node_serdes.cc')
-rw-r--r--src/node_serdes.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_serdes.cc b/src/node_serdes.cc
index c787721591..28844f1858 100644
--- a/src/node_serdes.cc
+++ b/src/node_serdes.cc
@@ -451,6 +451,7 @@ void Initialize(Local<Object> target,
ser->InstanceTemplate()->SetInternalFieldCount(
SerializerContext::kInternalFieldCount);
+ ser->Inherit(BaseObject::GetConstructorTemplate(env));
env->SetProtoMethod(ser, "writeHeader", SerializerContext::WriteHeader);
env->SetProtoMethod(ser, "writeValue", SerializerContext::WriteValue);
@@ -478,6 +479,7 @@ void Initialize(Local<Object> target,
des->InstanceTemplate()->SetInternalFieldCount(
DeserializerContext::kInternalFieldCount);
+ des->Inherit(BaseObject::GetConstructorTemplate(env));
env->SetProtoMethod(des, "readHeader", DeserializerContext::ReadHeader);
env->SetProtoMethod(des, "readValue", DeserializerContext::ReadValue);