src: use BaseObject::kInternalFieldCount in X509Certificate constructor

Use defined constant instead of hard-coding the field count

PR-URL: https://github.com/nodejs/node/pull/36892
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Joyee Cheung authored and Ruy Adorno committed 2021-01-24 21:43:35 -05:00
1 parent f07e1c9d03
commit d54998538e
1 file changed
+2 -1
+2 -1
View File
@@ -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"));