@@ -79,7 +79,6 @@ static const int X509_NAME_FLAGS = ASN1_STRFLGS_ESC_CTRL
7979namespace node {
8080namespace crypto {
8181
82- using v8::AccessorSignature;
8382using v8::Array;
8483using v8::Boolean;
8584using v8::Context;
@@ -102,8 +101,8 @@ using v8::Object;
102101using v8::ObjectTemplate;
103102using v8::Persistent;
104103using v8::PropertyAttribute;
105- using v8::PropertyCallbackInfo;
106104using v8::ReadOnly;
105+ using v8::Signature;
107106using v8::String;
108107using v8::Value;
109108
@@ -481,14 +480,18 @@ void SecureContext::Initialize(Environment* env, Local<Object> target) {
481480 t->Set (FIXED_ONE_BYTE_STRING (env->isolate (), " kTicketKeyIVIndex" ),
482481 Integer::NewFromUnsigned (env->isolate (), kTicketKeyIVIndex ));
483482
484- t->PrototypeTemplate ()->SetAccessor (
483+ Local<FunctionTemplate> ctx_getter_templ =
484+ FunctionTemplate::New (env->isolate (),
485+ CtxGetter,
486+ env->as_external (),
487+ Signature::New (env->isolate (), t));
488+
489+
490+ t->PrototypeTemplate ()->SetAccessorProperty (
485491 FIXED_ONE_BYTE_STRING (env->isolate (), " _external" ),
486- CtxGetter,
487- nullptr ,
488- env->as_external (),
489- DEFAULT,
490- static_cast <PropertyAttribute>(ReadOnly | DontDelete),
491- AccessorSignature::New (env->isolate (), t));
492+ ctx_getter_templ,
493+ Local<FunctionTemplate>(),
494+ static_cast <PropertyAttribute>(ReadOnly | DontDelete));
492495
493496 target->Set (secureContextString, t->GetFunction ());
494497 env->set_secure_context_constructor_template (t);
@@ -1457,8 +1460,7 @@ int SecureContext::TicketCompatibilityCallback(SSL* ssl,
14571460#endif
14581461
14591462
1460- void SecureContext::CtxGetter (Local<String> property,
1461- const PropertyCallbackInfo<Value>& info) {
1463+ void SecureContext::CtxGetter (const FunctionCallbackInfo<Value>& info) {
14621464 SecureContext* sc;
14631465 ASSIGN_OR_RETURN_UNWRAP (&sc, info.This ());
14641466 Local<External> ext = External::New (info.GetIsolate (), sc->ctx_ );
@@ -1528,14 +1530,17 @@ void SSLWrap<Base>::AddMethods(Environment* env, Local<FunctionTemplate> t) {
15281530 env->SetProtoMethod (t, " getALPNNegotiatedProtocol" , GetALPNNegotiatedProto);
15291531 env->SetProtoMethod (t, " setALPNProtocols" , SetALPNProtocols);
15301532
1531- t->PrototypeTemplate ()->SetAccessor (
1533+ Local<FunctionTemplate> ssl_getter_templ =
1534+ FunctionTemplate::New (env->isolate (),
1535+ SSLGetter,
1536+ env->as_external (),
1537+ Signature::New (env->isolate (), t));
1538+
1539+ t->PrototypeTemplate ()->SetAccessorProperty (
15321540 FIXED_ONE_BYTE_STRING (env->isolate (), " _external" ),
1533- SSLGetter,
1534- nullptr ,
1535- env->as_external (),
1536- DEFAULT,
1537- static_cast <PropertyAttribute>(ReadOnly | DontDelete),
1538- AccessorSignature::New (env->isolate (), t));
1541+ ssl_getter_templ,
1542+ Local<FunctionTemplate>(),
1543+ static_cast <PropertyAttribute>(ReadOnly | DontDelete));
15391544}
15401545
15411546
@@ -2696,8 +2701,7 @@ void SSLWrap<Base>::CertCbDone(const FunctionCallbackInfo<Value>& args) {
26962701
26972702
26982703template <class Base >
2699- void SSLWrap<Base>::SSLGetter (Local<String> property,
2700- const PropertyCallbackInfo<Value>& info) {
2704+ void SSLWrap<Base>::SSLGetter (const FunctionCallbackInfo<Value>& info) {
27012705 Base* base;
27022706 ASSIGN_OR_RETURN_UNWRAP (&base, info.This ());
27032707 SSL* ssl = base->ssl_ ;
@@ -4694,14 +4698,17 @@ void DiffieHellman::Initialize(Environment* env, Local<Object> target) {
46944698 env->SetProtoMethod (t, " setPublicKey" , SetPublicKey);
46954699 env->SetProtoMethod (t, " setPrivateKey" , SetPrivateKey);
46964700
4697- t->InstanceTemplate ()->SetAccessor (
4701+ Local<FunctionTemplate> verify_error_getter_templ =
4702+ FunctionTemplate::New (env->isolate (),
4703+ DiffieHellman::VerifyErrorGetter,
4704+ env->as_external (),
4705+ Signature::New (env->isolate (), t));
4706+
4707+ t->InstanceTemplate ()->SetAccessorProperty (
46984708 env->verify_error_string (),
4699- DiffieHellman::VerifyErrorGetter,
4700- nullptr ,
4701- env->as_external (),
4702- DEFAULT,
4703- attributes,
4704- AccessorSignature::New (env->isolate (), t));
4709+ verify_error_getter_templ,
4710+ Local<FunctionTemplate>(),
4711+ attributes);
47054712
47064713 target->Set (FIXED_ONE_BYTE_STRING (env->isolate (), " DiffieHellman" ),
47074714 t->GetFunction ());
@@ -4716,14 +4723,17 @@ void DiffieHellman::Initialize(Environment* env, Local<Object> target) {
47164723 env->SetProtoMethod (t2, " getPublicKey" , GetPublicKey);
47174724 env->SetProtoMethod (t2, " getPrivateKey" , GetPrivateKey);
47184725
4719- t2->InstanceTemplate ()->SetAccessor (
4726+ Local<FunctionTemplate> verify_error_getter_templ2 =
4727+ FunctionTemplate::New (env->isolate (),
4728+ DiffieHellman::VerifyErrorGetter,
4729+ env->as_external (),
4730+ Signature::New (env->isolate (), t2));
4731+
4732+ t2->InstanceTemplate ()->SetAccessorProperty (
47204733 env->verify_error_string (),
4721- DiffieHellman::VerifyErrorGetter,
4722- nullptr ,
4723- env->as_external (),
4724- DEFAULT,
4725- attributes,
4726- AccessorSignature::New (env->isolate (), t2));
4734+ verify_error_getter_templ2,
4735+ Local<FunctionTemplate>(),
4736+ attributes);
47274737
47284738 target->Set (FIXED_ONE_BYTE_STRING (env->isolate (), " DiffieHellmanGroup" ),
47294739 t2->GetFunction ());
@@ -5037,8 +5047,7 @@ void DiffieHellman::SetPrivateKey(const FunctionCallbackInfo<Value>& args) {
50375047}
50385048
50395049
5040- void DiffieHellman::VerifyErrorGetter (Local<String> property,
5041- const PropertyCallbackInfo<Value>& args) {
5050+ void DiffieHellman::VerifyErrorGetter (const FunctionCallbackInfo<Value>& args) {
50425051 HandleScope scope (args.GetIsolate ());
50435052
50445053 DiffieHellman* diffieHellman;
0 commit comments