Skip to content

Commit

Permalink
src: throw if functions used as constructors in node_crypto.cc
Browse files Browse the repository at this point in the history
Throw an error if verify_error_getter_templ or
verify_error_getter_templ2 are used as constructors.

PR-URL: #23582
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
  • Loading branch information
bmacnaughton authored and jasnell committed Oct 17, 2018
1 parent b6e9f99 commit b5f5585
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit b5f5585

Please sign in to comment.