From 20b3698ac14fdd9664654fa90302a5f8b6b58193 Mon Sep 17 00:00:00 2001 From: "Bruce A. MacNaughton" Date: Fri, 12 Oct 2018 11:20:55 -0700 Subject: [PATCH] src: throw if functions used as constructors in node_crypto.cc Throw an error if verify_error_getter_templ or verify_error_getter_templ2 are used as constructors. PR-URL: https://github.com/nodejs/node/pull/23582 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Tiancheng "Timothy" Gu --- src/node_crypto.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 627c14360e1..7d2cba22576 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -3940,8 +3940,7 @@ void DiffieHellman::Initialize(Environment* env, Local target) { env->as_external(), Signature::New(env->isolate(), t), /* length */ 0, - // TODO(TimothyGu): should be deny - ConstructorBehavior::kAllow, + ConstructorBehavior::kThrow, SideEffectType::kHasNoSideEffect); t->InstanceTemplate()->SetAccessorProperty( @@ -3969,8 +3968,7 @@ void DiffieHellman::Initialize(Environment* env, Local target) { env->as_external(), Signature::New(env->isolate(), t2), /* length */ 0, - // TODO(TimothyGu): should be deny - ConstructorBehavior::kAllow, + ConstructorBehavior::kThrow, SideEffectType::kHasNoSideEffect); t2->InstanceTemplate()->SetAccessorProperty(