Skip to content

Commit d549985

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 <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent f07e1c9 commit d549985

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/crypto/crypto_x509.cc

+2-1
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)