Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-04-08 18:14:00 +0300
committerAnna Henningsen <anna@addaleax.net>2020-06-14 15:53:38 +0300
commit8a7201b25fa2e5342b5d737742586bcd5ea1da5e (patch)
tree57382552b4b50d471b91ab41d19df3eeab0b67d4 /src/node_crypto.cc
parentc17d2f99018ae48ed82a90a9eccc570ed1ae83c6 (diff)
src: introduce BaseObject base FunctionTemplate
PR-URL: https://github.com/nodejs/node/pull/33772 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'src/node_crypto.cc')
-rw-r--r--src/node_crypto.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 360732e37fd..ca394f2e24e 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -455,6 +455,7 @@ void SecureContext::Initialize(Environment* env, Local<Object> target) {
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
t->InstanceTemplate()->SetInternalFieldCount(
SecureContext::kInternalFieldCount);
+ t->Inherit(BaseObject::GetConstructorTemplate(env));
Local<String> secureContextString =
FIXED_ONE_BYTE_STRING(env->isolate(), "SecureContext");
t->SetClassName(secureContextString);
@@ -3246,6 +3247,7 @@ Local<Function> KeyObject::Initialize(Environment* env, Local<Object> target) {
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
t->InstanceTemplate()->SetInternalFieldCount(
KeyObject::kInternalFieldCount);
+ t->Inherit(BaseObject::GetConstructorTemplate(env));
env->SetProtoMethod(t, "init", Init);
env->SetProtoMethodNoSideEffect(t, "getSymmetricKeySize",
@@ -3480,6 +3482,7 @@ void CipherBase::Initialize(Environment* env, Local<Object> target) {
t->InstanceTemplate()->SetInternalFieldCount(
CipherBase::kInternalFieldCount);
+ t->Inherit(BaseObject::GetConstructorTemplate(env));
env->SetProtoMethod(t, "init", Init);
env->SetProtoMethod(t, "initiv", InitIv);
@@ -4095,6 +4098,7 @@ void Hmac::Initialize(Environment* env, Local<Object> target) {
t->InstanceTemplate()->SetInternalFieldCount(
Hmac::kInternalFieldCount);
+ t->Inherit(BaseObject::GetConstructorTemplate(env));
env->SetProtoMethod(t, "init", HmacInit);
env->SetProtoMethod(t, "update", HmacUpdate);
@@ -4207,6 +4211,7 @@ void Hash::Initialize(Environment* env, Local<Object> target) {
t->InstanceTemplate()->SetInternalFieldCount(
Hash::kInternalFieldCount);
+ t->Inherit(BaseObject::GetConstructorTemplate(env));
env->SetProtoMethod(t, "update", HashUpdate);
env->SetProtoMethod(t, "digest", HashDigest);
@@ -4463,6 +4468,7 @@ void Sign::Initialize(Environment* env, Local<Object> target) {
t->InstanceTemplate()->SetInternalFieldCount(
SignBase::kInternalFieldCount);
+ t->Inherit(BaseObject::GetConstructorTemplate(env));
env->SetProtoMethod(t, "init", SignInit);
env->SetProtoMethod(t, "update", SignUpdate);
@@ -4785,6 +4791,7 @@ void Verify::Initialize(Environment* env, Local<Object> target) {
t->InstanceTemplate()->SetInternalFieldCount(
SignBase::kInternalFieldCount);
+ t->Inherit(BaseObject::GetConstructorTemplate(env));
env->SetProtoMethod(t, "init", VerifyInit);
env->SetProtoMethod(t, "update", VerifyUpdate);
@@ -5095,6 +5102,7 @@ void DiffieHellman::Initialize(Environment* env, Local<Object> target) {
t->InstanceTemplate()->SetInternalFieldCount(
DiffieHellman::kInternalFieldCount);
+ t->Inherit(BaseObject::GetConstructorTemplate(env));
env->SetProtoMethod(t, "generateKeys", GenerateKeys);
env->SetProtoMethod(t, "computeSecret", ComputeSecret);
@@ -5454,6 +5462,7 @@ void ECDH::Initialize(Environment* env, Local<Object> target) {
HandleScope scope(env->isolate());
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
+ t->Inherit(BaseObject::GetConstructorTemplate(env));
t->InstanceTemplate()->SetInternalFieldCount(ECDH::kInternalFieldCount);