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 <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
This commit is contained in:
Bruce A. MacNaughton 2018-10-12 11:20:55 -07:00 committed by Anna Henningsen
parent 541367ac8e
commit 20b3698ac1
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

View File

@ -3940,8 +3940,7 @@ void DiffieHellman::Initialize(Environment* env, Local<Object> 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<Object> 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(