Skip to content

Commit 3c12941

Browse files
joyeecheungruyadorno
authored andcommitted
src: use BaseObject::kInternalFieldCount in X509Certificate constructor
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]>
1 parent 82c05f5 commit 3c12941

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/crypto/crypto_x509.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ Local<FunctionTemplate> X509Certificate::GetConstructorTemplate(
5656
Local<FunctionTemplate> tmpl = env->x509_constructor_template();
5757
if (tmpl.IsEmpty()) {
5858
tmpl = FunctionTemplate::New(env->isolate());
59-
tmpl->InstanceTemplate()->SetInternalFieldCount(1);
59+
tmpl->InstanceTemplate()->SetInternalFieldCount(
60+
BaseObject::kInternalFieldCount);
6061
tmpl->Inherit(BaseObject::GetConstructorTemplate(env));
6162
tmpl->SetClassName(
6263
FIXED_ONE_BYTE_STRING(env->isolate(), "X509Certificate"));

0 commit comments

Comments
 (0)