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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
joyeecheung authored and ruyadorno committed Jan 21, 2021
1 parent 82c05f5 commit 3c12941
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 3c12941

Please sign in to comment.