@@ -26,7 +26,6 @@ using v8::Function;
2626using v8::FunctionCallbackInfo;
2727using v8::FunctionTemplate;
2828using v8::Handle;
29- using v8::HandleScope;
3029using v8::Integer;
3130using v8::Local;
3231using v8::Null;
@@ -251,8 +250,6 @@ void TLSWrap::SSLInfoCallback(const SSL* ssl_, int where, int ret) {
251250 SSL* ssl = const_cast <SSL*>(ssl_);
252251 TLSWrap* c = static_cast <TLSWrap*>(SSL_get_app_data (ssl));
253252 Environment* env = c->env ();
254- HandleScope handle_scope (env->isolate ());
255- Context::Scope context_scope (env->context ());
256253 Local<Object> object = c->object ();
257254
258255 if (where & SSL_CB_HANDSHAKE_START) {
@@ -395,9 +392,6 @@ void TLSWrap::ClearOut() {
395392 if (eof_)
396393 return ;
397394
398- HandleScope handle_scope (env ()->isolate ());
399- Context::Scope context_scope (env ()->context ());
400-
401395 CHECK_NE (ssl_, nullptr );
402396
403397 char out[kClearOutChunkSize ];
@@ -470,9 +464,6 @@ bool TLSWrap::ClearIn() {
470464 return true ;
471465 }
472466
473- HandleScope handle_scope (env ()->isolate ());
474- Context::Scope context_scope (env ()->context ());
475-
476467 // Error or partial write
477468 int err;
478469 Local<Value> arg = GetSSLError (written, &err, &error_);
@@ -588,8 +579,6 @@ int TLSWrap::DoWrite(WriteWrap* w,
588579
589580 if (i != count) {
590581 int err;
591- HandleScope handle_scope (env ()->isolate ());
592- Context::Scope context_scope (env ()->context ());
593582 Local<Value> arg = GetSSLError (written, &err, &error_);
594583 if (!arg.IsEmpty ())
595584 return UV_EPROTO;
@@ -662,8 +651,6 @@ void TLSWrap::DoRead(ssize_t nread,
662651 eof_ = true ;
663652 }
664653
665- HandleScope handle_scope (env ()->isolate ());
666- Context::Scope context_scope (env ()->context ());
667654 OnRead (nread, nullptr );
668655 return ;
669656 }
@@ -796,7 +783,6 @@ int TLSWrap::SelectSNIContextCallback(SSL* s, int* ad, void* arg) {
796783 if (servername == nullptr )
797784 return SSL_TLSEXT_ERR_OK;
798785
799- HandleScope scope (env->isolate ());
800786 // Call the SNI callback and use its return value as context
801787 Local<Object> object = p->object ();
802788 Local<Value> ctx = object->Get (env->sni_context_string ());
0 commit comments