From 3c12941359421cecd0e7228ccc1421562112b015 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 12 Jan 2021 22:39:56 +0800 Subject: [PATCH] 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 Reviewed-By: James M Snell --- src/crypto/crypto_x509.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crypto/crypto_x509.cc b/src/crypto/crypto_x509.cc index 9c85f035d2ad82..0ea91bca877564 100644 --- a/src/crypto/crypto_x509.cc +++ b/src/crypto/crypto_x509.cc @@ -56,7 +56,8 @@ Local X509Certificate::GetConstructorTemplate( Local 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"));