Skip to content

Commit

Permalink
src: use BaseObject::kInternalFieldCount in X509Certificate constructor
Browse files Browse the repository at this point in the history
Use defined constant instead of hard-coding the field count

PR-URL: #36892
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
joyeecheung authored and ruyadorno committed Jan 25, 2021
1 parent f07e1c9 commit d549985
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/crypto/crypto_x509.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ Local<FunctionTemplate> X509Certificate::GetConstructorTemplate(
Local<FunctionTemplate> tmpl = env->x509_constructor_template();
if (tmpl.IsEmpty()) {
tmpl = FunctionTemplate::New(env->isolate());
tmpl->InstanceTemplate()->SetInternalFieldCount(1);
tmpl->InstanceTemplate()->SetInternalFieldCount(
BaseObject::kInternalFieldCount);
tmpl->Inherit(BaseObject::GetConstructorTemplate(env));
tmpl->SetClassName(
FIXED_ONE_BYTE_STRING(env->isolate(), "X509Certificate"));
Expand Down

0 comments on commit d549985

Please sign in to comment.