From 97585b0d7ab0084d90faf6bded275b902d76857a Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 11 Oct 2014 16:24:12 +0200 Subject: [PATCH] src: remove unnecessary HandleScopes API callback functions don't need to create a v8::HandleScope instance because V8 already creates one in the JS->C++ adapter frame. PR-URL: https://github.com/node-forward/node/pull/16 Reviewed-By: Fedor Indutny --- src/cares_wrap.cc | 7 --- src/fs_event_wrap.cc | 5 -- src/handle_wrap.cc | 7 --- src/node.cc | 26 -------- src/node_buffer.cc | 5 -- src/node_contextify.cc | 6 -- src/node_crypto.cc | 131 --------------------------------------- src/node_dtrace.cc | 6 -- src/node_file.cc | 25 -------- src/node_http_parser.cc | 6 -- src/node_os.cc | 14 ----- src/node_stat_watcher.cc | 4 -- src/node_v8.cc | 3 - src/node_zlib.cc | 9 --- src/pipe_wrap.cc | 16 ----- src/process_wrap.cc | 5 -- src/signal_wrap.cc | 7 --- src/smalloc.cc | 6 -- src/spawn_sync.cc | 1 - src/stream_wrap.cc | 18 ------ src/tcp_wrap.cc | 36 ----------- src/timer_wrap.cc | 1 - src/tls_wrap.cc | 15 ----- src/tty_wrap.cc | 10 --- src/udp_wrap.cc | 15 ----- src/uv.cc | 2 - 26 files changed, 386 deletions(-) diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 356df86907..c6ffcf0fac 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -841,7 +841,6 @@ class GetHostByNameWrap: public QueryWrap { template static void Query(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); assert(!args.IsConstructCall()); @@ -992,7 +991,6 @@ void AfterGetNameInfo(uv_getnameinfo_t* req, static void IsIP(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); node::Utf8Value ip(args[0]); char address_buffer[sizeof(struct in6_addr)]; @@ -1008,7 +1006,6 @@ static void IsIP(const FunctionCallbackInfo& args) { static void GetAddrInfo(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); assert(args[0]->IsObject()); @@ -1062,7 +1059,6 @@ static void GetAddrInfo(const FunctionCallbackInfo& args) { static void GetNameInfo(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope handle_scope(env->isolate()); CHECK(args[0]->IsObject()); CHECK(args[1]->IsString()); @@ -1094,7 +1090,6 @@ static void GetNameInfo(const FunctionCallbackInfo& args) { static void GetServers(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); Local server_array = Array::New(env->isolate()); @@ -1124,7 +1119,6 @@ static void GetServers(const FunctionCallbackInfo& args) { static void SetServers(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); assert(args[0]->IsArray()); @@ -1194,7 +1188,6 @@ static void SetServers(const FunctionCallbackInfo& args) { static void StrError(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); const char* errmsg = ares_strerror(args[0]->Int32Value()); args.GetReturnValue().Set(OneByteString(env->isolate(), errmsg)); } diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index 04f3b997fd..133acec070 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -96,7 +96,6 @@ void FSEventWrap::Initialize(Handle target, void FSEventWrap::New(const FunctionCallbackInfo& args) { assert(args.IsConstructCall()); - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); new FSEventWrap(env, args.This()); } @@ -104,7 +103,6 @@ void FSEventWrap::New(const FunctionCallbackInfo& args) { void FSEventWrap::Start(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); FSEventWrap* wrap = Unwrap(args.Holder()); @@ -186,9 +184,6 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename, void FSEventWrap::Close(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - FSEventWrap* wrap = Unwrap(args.Holder()); if (wrap == NULL || wrap->initialized_ == false) diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc index 83015f1dfd..eeda93017f 100644 --- a/src/handle_wrap.cc +++ b/src/handle_wrap.cc @@ -41,9 +41,6 @@ using v8::Value; void HandleWrap::Ref(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - HandleWrap* wrap = Unwrap(args.Holder()); if (wrap != NULL && wrap->handle__ != NULL) { @@ -54,9 +51,6 @@ void HandleWrap::Ref(const FunctionCallbackInfo& args) { void HandleWrap::Unref(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - HandleWrap* wrap = Unwrap(args.Holder()); if (wrap != NULL && wrap->handle__ != NULL) { @@ -68,7 +62,6 @@ void HandleWrap::Unref(const FunctionCallbackInfo& args) { void HandleWrap::Close(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); HandleWrap* wrap = Unwrap(args.Holder()); diff --git a/src/node.cc b/src/node.cc index 50081c059a..023ef1ee09 100644 --- a/src/node.cc +++ b/src/node.cc @@ -909,7 +909,6 @@ Local WinapiErrnoException(Isolate* isolate, void SetupAsyncListener(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); assert(args[0]->IsObject()); @@ -979,7 +978,6 @@ void RunMicrotasks(const FunctionCallbackInfo& args) { void SetupNextTick(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); assert(args[0]->IsObject()); @@ -1552,7 +1550,6 @@ static Local ExecuteString(Environment* env, static void GetActiveRequests(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Local ary = Array::New(args.GetIsolate()); QUEUE* q = NULL; @@ -1573,7 +1570,6 @@ static void GetActiveRequests(const FunctionCallbackInfo& args) { // implemented here for consistency with GetActiveRequests(). void GetActiveHandles(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Local ary = Array::New(env->isolate()); QUEUE* q = NULL; @@ -1603,7 +1599,6 @@ static void Abort(const FunctionCallbackInfo& args) { static void Chdir(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() != 1 || !args[0]->IsString()) { // FIXME(bnoordhuis) ThrowTypeError? @@ -1620,7 +1615,6 @@ static void Chdir(const FunctionCallbackInfo& args) { static void Cwd(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); #ifdef _WIN32 /* MAX_PATH is in characters, not bytes. Make sure we have enough headroom. */ char buf[MAX_PATH * 4]; @@ -1644,7 +1638,6 @@ static void Cwd(const FunctionCallbackInfo& args) { static void Umask(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); uint32_t old; if (args.Length() < 1 || args[0]->IsUndefined()) { @@ -1793,7 +1786,6 @@ static void GetGid(const FunctionCallbackInfo& args) { static void SetGid(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (!args[0]->IsUint32() && !args[0]->IsString()) { return env->ThrowTypeError("setgid argument must be a number or a string"); @@ -1813,7 +1805,6 @@ static void SetGid(const FunctionCallbackInfo& args) { static void SetUid(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (!args[0]->IsUint32() && !args[0]->IsString()) { return env->ThrowTypeError("setuid argument must be a number or a string"); @@ -1833,7 +1824,6 @@ static void SetUid(const FunctionCallbackInfo& args) { static void GetGroups(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); int ngroups = getgroups(0, NULL); @@ -1872,7 +1862,6 @@ static void GetGroups(const FunctionCallbackInfo& args) { static void SetGroups(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (!args[0]->IsArray()) { return env->ThrowTypeError("argument 1 must be an array"); @@ -1904,7 +1893,6 @@ static void SetGroups(const FunctionCallbackInfo& args) { static void InitGroups(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (!args[0]->IsUint32() && !args[0]->IsString()) { return env->ThrowTypeError("argument 1 must be a number or a string"); @@ -1954,15 +1942,12 @@ static void InitGroups(const FunctionCallbackInfo& args) { void Exit(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); exit(args[0]->Int32Value()); } static void Uptime(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); double uptime; uv_update_time(env->event_loop()); @@ -1974,7 +1959,6 @@ static void Uptime(const FunctionCallbackInfo& args) { void MemoryUsage(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); size_t rss; int err = uv_resident_set_memory(&rss); @@ -2002,7 +1986,6 @@ void MemoryUsage(const FunctionCallbackInfo& args) { void Kill(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() != 2) { return env->ThrowError("Bad argument."); @@ -2024,7 +2007,6 @@ void Kill(const FunctionCallbackInfo& args) { // Pass in an Array from a previous hrtime() call to instead get a time diff. void Hrtime(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); uint64_t t = uv_hrtime(); @@ -2079,7 +2061,6 @@ typedef void (UV_DYNAMIC* extInit)(Handle exports); // when two contexts try to load the same shared object. Maybe have a shadow // cache that's a plain C list or hash table that's shared across contexts? void DLOpen(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); struct node_module* mp; uv_lib_t lib; @@ -2223,7 +2204,6 @@ void OnMessage(Handle message, Handle error) { static void Binding(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); Local module = args[0]->ToString(); @@ -2528,7 +2508,6 @@ static void DebugEnd(const FunctionCallbackInfo& args); void NeedImmediateCallbackGetter(Local property, const PropertyCallbackInfo& info) { - HandleScope handle_scope(info.GetIsolate()); Environment* env = Environment::GetCurrent(info.GetIsolate()); const uv_check_t* immediate_check_handle = env->immediate_check_handle(); bool active = uv_is_active( @@ -2589,14 +2568,12 @@ void StopProfilerIdleNotifier(Environment* env) { void StartProfilerIdleNotifier(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); StartProfilerIdleNotifier(env); } void StopProfilerIdleNotifier(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); StopProfilerIdleNotifier(env); } @@ -2847,7 +2824,6 @@ static void SignalExit(int signo) { // function, it is useful to bypass JavaScript entirely. static void RawDebug(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); assert(args.Length() == 1 && args[0]->IsString() && "must be called with a single string"); @@ -3217,7 +3193,6 @@ static void RegisterSignalHandler(int signal, void DebugProcess(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() != 1) { return env->ThrowError("Invalid number of arguments."); @@ -3306,7 +3281,6 @@ static int RegisterDebugSignalHandler() { static void DebugProcess(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); Environment* env = Environment::GetCurrent(isolate); - HandleScope scope(isolate); DWORD pid; HANDLE process = NULL; HANDLE thread = NULL; diff --git a/src/node_buffer.cc b/src/node_buffer.cc index cd66a8ac74..00b1f445a1 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -257,7 +257,6 @@ Local Use(Environment* env, char* data, uint32_t length) { template void StringSlice(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); ARGS_THIS(args.This()) SLICE_START_END(args[0], args[1], obj_length) @@ -300,7 +299,6 @@ void Base64Slice(const FunctionCallbackInfo& args) { // bytesCopied = buffer.copy(target[, targetStart][, sourceStart][, sourceEnd]); void Copy(const FunctionCallbackInfo &args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Local target = args[0]->ToObject(); @@ -381,7 +379,6 @@ void Fill(const FunctionCallbackInfo& args) { template void StringWrite(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); ARGS_THIS(args.This()) @@ -546,7 +543,6 @@ void WriteDoubleBE(const FunctionCallbackInfo& args) { void ByteLength(const FunctionCallbackInfo &args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (!args[0]->IsString()) return env->ThrowTypeError("Argument must be a string"); @@ -595,7 +591,6 @@ void Compare(const FunctionCallbackInfo &args) { // pass Buffer object to load prototype methods void SetupBufferJS(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); assert(args[0]->IsFunction()); diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 3f190a407b..bb7f4f1f37 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -253,7 +253,6 @@ class ContextifyContext { static void RunInDebugContext(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); Local script_source(args[0]->ToString()); if (script_source.IsEmpty()) return; // Exception pending. @@ -267,7 +266,6 @@ class ContextifyContext { static void MakeContext(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (!args[0]->IsObject()) { return env->ThrowTypeError("sandbox argument must be an object."); @@ -298,7 +296,6 @@ class ContextifyContext { static void IsContext(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (!args[0]->IsObject()) { env->ThrowTypeError("sandbox must be an object"); @@ -473,7 +470,6 @@ class ContextifyScript : public BaseObject { // args: code, [options] static void New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (!args.IsConstructCall()) { return env->ThrowError("Must call vm.Script as a constructor."); @@ -516,7 +512,6 @@ class ContextifyScript : public BaseObject { // args: [options] static void RunInThisContext(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); - HandleScope handle_scope(isolate); // Assemble arguments TryCatch try_catch; @@ -535,7 +530,6 @@ class ContextifyScript : public BaseObject { // args: sandbox, [options] static void RunInContext(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); int64_t timeout; bool display_errors; diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 7a35314a94..7e7ff232b7 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -299,15 +299,12 @@ void SecureContext::Initialize(Environment* env, Handle target) { void SecureContext::New(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); new SecureContext(env, args.This()); } void SecureContext::Init(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - SecureContext* sc = Unwrap(args.Holder()); Environment* env = sc->env(); @@ -434,7 +431,6 @@ static X509* LoadX509(Environment* env, Handle v) { void SecureContext::SetKey(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); SecureContext* sc = Unwrap(args.Holder()); @@ -580,7 +576,6 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx, void SecureContext::SetCert(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); SecureContext* sc = Unwrap(args.Holder()); @@ -612,7 +607,6 @@ void SecureContext::SetCert(const FunctionCallbackInfo& args) { void SecureContext::AddCACert(const FunctionCallbackInfo& args) { bool newCAStore = false; Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); SecureContext* sc = Unwrap(args.Holder()); @@ -642,7 +636,6 @@ void SecureContext::AddCACert(const FunctionCallbackInfo& args) { void SecureContext::AddCRL(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); SecureContext* sc = Unwrap(args.Holder()); @@ -674,8 +667,6 @@ void SecureContext::AddCRL(const FunctionCallbackInfo& args) { void SecureContext::AddRootCerts(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - SecureContext* sc = Unwrap(args.Holder()); assert(sc->ca_store_ == NULL); @@ -711,8 +702,6 @@ void SecureContext::AddRootCerts(const FunctionCallbackInfo& args) { void SecureContext::SetCiphers(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - SecureContext* sc = Unwrap(args.Holder()); if (args.Length() != 1 || !args[0]->IsString()) { @@ -725,8 +714,6 @@ void SecureContext::SetCiphers(const FunctionCallbackInfo& args) { void SecureContext::SetECDHCurve(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - SecureContext* sc = Unwrap(args.Holder()); Environment* env = sc->env(); @@ -753,8 +740,6 @@ void SecureContext::SetECDHCurve(const FunctionCallbackInfo& args) { void SecureContext::SetDHParam(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - SecureContext* sc = Unwrap(args.This()); Environment* env = sc->env(); @@ -784,8 +769,6 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo& args) { void SecureContext::SetOptions(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - SecureContext* sc = Unwrap(args.Holder()); if (args.Length() != 1 || !args[0]->IntegerValue()) { @@ -798,8 +781,6 @@ void SecureContext::SetOptions(const FunctionCallbackInfo& args) { void SecureContext::SetSessionIdContext( const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - SecureContext* sc = Unwrap(args.Holder()); if (args.Length() != 1 || !args[0]->IsString()) { @@ -835,8 +816,6 @@ void SecureContext::SetSessionIdContext( void SecureContext::SetSessionTimeout(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - SecureContext* sc = Unwrap(args.Holder()); if (args.Length() != 1 || !args[0]->IsInt32()) { @@ -849,7 +828,6 @@ void SecureContext::SetSessionTimeout(const FunctionCallbackInfo& args) { void SecureContext::Close(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); SecureContext* sc = Unwrap(args.Holder()); sc->FreeCTXMem(); } @@ -858,7 +836,6 @@ void SecureContext::Close(const FunctionCallbackInfo& args) { // Takes .pfx or .p12 and password in string or buffer format void SecureContext::LoadPKCS12(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); BIO* in = NULL; PKCS12* p12 = NULL; @@ -924,7 +901,6 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo& args) { void SecureContext::GetTicketKeys(const FunctionCallbackInfo& args) { #if !defined(OPENSSL_NO_TLSEXT) && defined(SSL_CTX_get_tlsext_ticket_keys) - HandleScope handle_scope(args.GetIsolate()); SecureContext* wrap = Unwrap(args.Holder()); @@ -942,7 +918,6 @@ void SecureContext::GetTicketKeys(const FunctionCallbackInfo& args) { void SecureContext::SetTicketKeys(const FunctionCallbackInfo& args) { #if !defined(OPENSSL_NO_TLSEXT) && defined(SSL_CTX_get_tlsext_ticket_keys) - HandleScope scope(args.GetIsolate()); SecureContext* wrap = Unwrap(args.Holder()); if (args.Length() < 1 || @@ -974,7 +949,6 @@ void SecureContext::CtxGetter(Local property, template void SecureContext::GetCertificate(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); SecureContext* wrap = Unwrap(args.Holder()); Environment* env = wrap->env(); X509* cert; @@ -1298,8 +1272,6 @@ static Local X509ToObject(Environment* env, X509* cert) { template void SSLWrap::GetPeerCertificate( const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Base* w = Unwrap(args.Holder()); Environment* env = w->ssl_env(); @@ -1406,7 +1378,6 @@ void SSLWrap::GetPeerCertificate( template void SSLWrap::GetSession(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Base* w = Unwrap(args.Holder()); @@ -1428,7 +1399,6 @@ void SSLWrap::GetSession(const FunctionCallbackInfo& args) { template void SSLWrap::SetSession(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Base* w = Unwrap(args.Holder()); @@ -1460,8 +1430,6 @@ void SSLWrap::SetSession(const FunctionCallbackInfo& args) { template void SSLWrap::LoadSession(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Base* w = Unwrap(args.Holder()); Environment* env = w->ssl_env(); @@ -1493,7 +1461,6 @@ void SSLWrap::LoadSession(const FunctionCallbackInfo& args) { template void SSLWrap::IsSessionReused(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); Base* w = Unwrap(args.Holder()); bool yes = SSL_session_reused(w->ssl_); args.GetReturnValue().Set(yes); @@ -1502,7 +1469,6 @@ void SSLWrap::IsSessionReused(const FunctionCallbackInfo& args) { template void SSLWrap::EndParser(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); Base* w = Unwrap(args.Holder()); w->hello_parser_.End(); } @@ -1510,8 +1476,6 @@ void SSLWrap::EndParser(const FunctionCallbackInfo& args) { template void SSLWrap::Renegotiate(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Base* w = Unwrap(args.Holder()); ClearErrorOnReturn clear_error_on_return; @@ -1524,8 +1488,6 @@ void SSLWrap::Renegotiate(const FunctionCallbackInfo& args) { template void SSLWrap::Shutdown(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Base* w = Unwrap(args.Holder()); int rv = SSL_shutdown(w->ssl_); @@ -1535,8 +1497,6 @@ void SSLWrap::Shutdown(const FunctionCallbackInfo& args) { template void SSLWrap::GetTLSTicket(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Base* w = Unwrap(args.Holder()); Environment* env = w->ssl_env(); @@ -1554,8 +1514,6 @@ void SSLWrap::GetTLSTicket(const FunctionCallbackInfo& args) { template void SSLWrap::NewSessionDone(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Base* w = Unwrap(args.Holder()); w->new_session_wait_ = false; w->NewSessionDoneCb(); @@ -1607,7 +1565,6 @@ void SSLWrap::SetMaxSendFragment( template void SSLWrap::IsInitFinished(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); Base* w = Unwrap(args.Holder()); bool yes = SSL_is_init_finished(w->ssl_); args.GetReturnValue().Set(yes); @@ -1616,8 +1573,6 @@ void SSLWrap::IsInitFinished(const FunctionCallbackInfo& args) { template void SSLWrap::VerifyError(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Base* w = Unwrap(args.Holder()); // XXX(bnoordhuis) The UNABLE_TO_GET_ISSUER_CERT error when there is no @@ -1681,8 +1636,6 @@ void SSLWrap::VerifyError(const FunctionCallbackInfo& args) { template void SSLWrap::GetCurrentCipher(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Base* w = Unwrap(args.Holder()); Environment* env = w->ssl_env(); @@ -1783,8 +1736,6 @@ int SSLWrap::SelectNextProtoCallback(SSL* s, template void SSLWrap::GetNegotiatedProto( const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Base* w = Unwrap(args.Holder()); if (w->is_client()) { @@ -1809,8 +1760,6 @@ void SSLWrap::GetNegotiatedProto( template void SSLWrap::SetNPNProtocols(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Base* w = Unwrap(args.Holder()); if (args.Length() < 1 || !Buffer::HasInstance(args[0])) @@ -2156,7 +2105,6 @@ int Connection::SelectSNIContextCallback_(SSL *s, int *ad, void* arg) { void Connection::New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 1 || !args[0]->IsObject()) { env->ThrowError("First argument must be a tls module SecureContext"); @@ -2249,8 +2197,6 @@ void Connection::SSLInfoCallback(const SSL *ssl_, int where, int ret) { void Connection::EncIn(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Connection* conn = Unwrap(args.Holder()); Environment* env = conn->env(); @@ -2300,8 +2246,6 @@ void Connection::EncIn(const FunctionCallbackInfo& args) { void Connection::ClearOut(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Connection* conn = Unwrap(args.Holder()); Environment* env = conn->env(); @@ -2356,7 +2300,6 @@ void Connection::ClearOut(const FunctionCallbackInfo& args) { void Connection::ClearPending(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); Connection* conn = Unwrap(args.Holder()); int bytes_pending = BIO_pending(conn->bio_read_); args.GetReturnValue().Set(bytes_pending); @@ -2364,7 +2307,6 @@ void Connection::ClearPending(const FunctionCallbackInfo& args) { void Connection::EncPending(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); Connection* conn = Unwrap(args.Holder()); int bytes_pending = BIO_pending(conn->bio_write_); args.GetReturnValue().Set(bytes_pending); @@ -2372,8 +2314,6 @@ void Connection::EncPending(const FunctionCallbackInfo& args) { void Connection::EncOut(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Connection* conn = Unwrap(args.Holder()); Environment* env = conn->env(); @@ -2404,8 +2344,6 @@ void Connection::EncOut(const FunctionCallbackInfo& args) { void Connection::ClearIn(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Connection* conn = Unwrap(args.Holder()); Environment* env = conn->env(); @@ -2460,8 +2398,6 @@ void Connection::ClearIn(const FunctionCallbackInfo& args) { void Connection::Start(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Connection* conn = Unwrap(args.Holder()); int rv = 0; @@ -2485,8 +2421,6 @@ void Connection::Start(const FunctionCallbackInfo& args) { void Connection::Close(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Connection* conn = Unwrap(args.Holder()); if (conn->ssl_ != NULL) { @@ -2498,8 +2432,6 @@ void Connection::Close(const FunctionCallbackInfo& args) { #ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB void Connection::GetServername(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Connection* conn = Unwrap(args.Holder()); if (conn->is_server() && !conn->servername_.IsEmpty()) { @@ -2511,8 +2443,6 @@ void Connection::GetServername(const FunctionCallbackInfo& args) { void Connection::SetSNICallback(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Connection* conn = Unwrap(args.Holder()); Environment* env = conn->env(); @@ -2548,7 +2478,6 @@ void CipherBase::Initialize(Environment* env, Handle target) { void CipherBase::New(const FunctionCallbackInfo& args) { assert(args.IsConstructCall() == true); - HandleScope handle_scope(args.GetIsolate()); CipherKind kind = args[0]->IsTrue() ? kCipher : kDecipher; Environment* env = Environment::GetCurrent(args.GetIsolate()); new CipherBase(env, args.This(), kind); @@ -2596,8 +2525,6 @@ void CipherBase::Init(const char* cipher_type, void CipherBase::Init(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - CipherBase* cipher = Unwrap(args.Holder()); if (args.Length() < 2 || @@ -2648,8 +2575,6 @@ void CipherBase::InitIv(const char* cipher_type, void CipherBase::InitIv(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - CipherBase* cipher = Unwrap(args.Holder()); Environment* env = cipher->env(); @@ -2691,7 +2616,6 @@ bool CipherBase::GetAuthTag(char** out, unsigned int* out_len) const { void CipherBase::GetAuthTag(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope handle_scope(args.GetIsolate()); CipherBase* cipher = Unwrap(args.Holder()); char* out = NULL; @@ -2718,7 +2642,6 @@ bool CipherBase::SetAuthTag(const char* data, unsigned int len) { void CipherBase::SetAuthTag(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); Local buf = args[0].As(); @@ -2749,7 +2672,6 @@ bool CipherBase::SetAAD(const char* data, unsigned int len) { void CipherBase::SetAAD(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope handle_scope(env->isolate()); ASSERT_IS_BUFFER(args[0]); @@ -2788,7 +2710,6 @@ bool CipherBase::Update(const char* data, void CipherBase::Update(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); CipherBase* cipher = Unwrap(args.Holder()); @@ -2843,7 +2764,6 @@ bool CipherBase::SetAutoPadding(bool auto_padding) { void CipherBase::SetAutoPadding(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); CipherBase* cipher = Unwrap(args.Holder()); cipher->SetAutoPadding(args.Length() < 1 || args[0]->BooleanValue()); } @@ -2878,7 +2798,6 @@ bool CipherBase::Final(unsigned char** out, int *out_len) { void CipherBase::Final(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); CipherBase* cipher = Unwrap(args.Holder()); @@ -2924,7 +2843,6 @@ void Hmac::Initialize(Environment* env, v8::Handle target) { void Hmac::New(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); new Hmac(env, args.This()); } @@ -2949,8 +2867,6 @@ void Hmac::HmacInit(const char* hash_type, const char* key, int key_len) { void Hmac::HmacInit(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Hmac* hmac = Unwrap(args.Holder()); Environment* env = hmac->env(); @@ -2977,7 +2893,6 @@ bool Hmac::HmacUpdate(const char* data, int len) { void Hmac::HmacUpdate(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Hmac* hmac = Unwrap(args.Holder()); @@ -3024,7 +2939,6 @@ bool Hmac::HmacDigest(unsigned char** md_value, unsigned int* md_len) { void Hmac::HmacDigest(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Hmac* hmac = Unwrap(args.Holder()); @@ -3065,7 +2979,6 @@ void Hash::Initialize(Environment* env, v8::Handle target) { void Hash::New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() == 0 || !args[0]->IsString()) { return env->ThrowError("Must give hashtype string as argument"); @@ -3102,7 +3015,6 @@ bool Hash::HashUpdate(const char* data, int len) { void Hash::HashUpdate(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Hash* hash = Unwrap(args.Holder()); @@ -3138,7 +3050,6 @@ void Hash::HashUpdate(const FunctionCallbackInfo& args) { void Hash::HashDigest(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Hash* hash = Unwrap(args.Holder()); @@ -3220,7 +3131,6 @@ void Sign::Initialize(Environment* env, v8::Handle target) { void Sign::New(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); new Sign(env, args.This()); } @@ -3242,8 +3152,6 @@ SignBase::Error Sign::SignInit(const char* sign_type) { void Sign::SignInit(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Sign* sign = Unwrap(args.Holder()); if (args.Length() == 0 || !args[0]->IsString()) { @@ -3266,7 +3174,6 @@ SignBase::Error Sign::SignUpdate(const char* data, int len) { void Sign::SignUpdate(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Sign* sign = Unwrap(args.Holder()); @@ -3343,7 +3250,6 @@ SignBase::Error Sign::SignFinal(const char* key_pem, void Sign::SignFinal(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Sign* sign = Unwrap(args.Holder()); @@ -3402,7 +3308,6 @@ void Verify::Initialize(Environment* env, v8::Handle target) { void Verify::New(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); new Verify(env, args.This()); } @@ -3424,8 +3329,6 @@ SignBase::Error Verify::VerifyInit(const char* verify_type) { void Verify::VerifyInit(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Verify* verify = Unwrap(args.Holder()); if (args.Length() == 0 || !args[0]->IsString()) { @@ -3450,7 +3353,6 @@ SignBase::Error Verify::VerifyUpdate(const char* data, int len) { void Verify::VerifyUpdate(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Verify* verify = Unwrap(args.Holder()); @@ -3558,7 +3460,6 @@ SignBase::Error Verify::VerifyFinal(const char* key_pem, void Verify::VerifyFinal(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Verify* verify = Unwrap(args.Holder()); @@ -3691,7 +3592,6 @@ template void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); ASSERT_IS_BUFFER(args[0]); char* kbuf = Buffer::Data(args[0]); @@ -3823,8 +3723,6 @@ bool DiffieHellman::Init(const char* p, int p_len, const char* g, int g_len) { void DiffieHellman::DiffieHellmanGroup( const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Environment* env = Environment::GetCurrent(args.GetIsolate()); DiffieHellman* diffieHellman = new DiffieHellman(env, args.This()); @@ -3855,8 +3753,6 @@ void DiffieHellman::DiffieHellmanGroup( void DiffieHellman::New(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Environment* env = Environment::GetCurrent(args.GetIsolate()); DiffieHellman* diffieHellman = new DiffieHellman(env, args.This()); @@ -3890,7 +3786,6 @@ void DiffieHellman::New(const FunctionCallbackInfo& args) { void DiffieHellman::GenerateKeys(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); DiffieHellman* diffieHellman = Unwrap(args.Holder()); @@ -3914,7 +3809,6 @@ void DiffieHellman::GenerateKeys(const FunctionCallbackInfo& args) { void DiffieHellman::GetPrime(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); DiffieHellman* diffieHellman = Unwrap(args.Holder()); @@ -3933,7 +3827,6 @@ void DiffieHellman::GetPrime(const FunctionCallbackInfo& args) { void DiffieHellman::GetGenerator(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); DiffieHellman* diffieHellman = Unwrap(args.Holder()); @@ -3952,7 +3845,6 @@ void DiffieHellman::GetGenerator(const FunctionCallbackInfo& args) { void DiffieHellman::GetPublicKey(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); DiffieHellman* diffieHellman = Unwrap(args.Holder()); @@ -3976,7 +3868,6 @@ void DiffieHellman::GetPublicKey(const FunctionCallbackInfo& args) { void DiffieHellman::GetPrivateKey(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); DiffieHellman* diffieHellman = Unwrap(args.Holder()); @@ -4000,7 +3891,6 @@ void DiffieHellman::GetPrivateKey(const FunctionCallbackInfo& args) { void DiffieHellman::ComputeSecret(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); DiffieHellman* diffieHellman = Unwrap(args.Holder()); @@ -4071,8 +3961,6 @@ void DiffieHellman::ComputeSecret(const FunctionCallbackInfo& args) { void DiffieHellman::SetPublicKey(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - DiffieHellman* diffieHellman = Unwrap(args.Holder()); Environment* env = diffieHellman->env(); @@ -4092,8 +3980,6 @@ void DiffieHellman::SetPublicKey(const FunctionCallbackInfo& args) { void DiffieHellman::SetPrivateKey(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - DiffieHellman* diffieHellman = Unwrap(args.Holder()); Environment* env = diffieHellman->env(); @@ -4156,7 +4042,6 @@ void ECDH::Initialize(Environment* env, Handle target) { void ECDH::New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); // TODO(indutny): Support raw curves? CHECK(args[0]->IsString()); @@ -4176,7 +4061,6 @@ void ECDH::New(const FunctionCallbackInfo& args) { void ECDH::GenerateKeys(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); ECDH* ecdh = Unwrap(args.Holder()); @@ -4218,7 +4102,6 @@ EC_POINT* ECDH::BufferToPoint(char* data, size_t len) { void ECDH::ComputeSecret(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); ASSERT_IS_BUFFER(args[0]); @@ -4248,7 +4131,6 @@ void ECDH::ComputeSecret(const FunctionCallbackInfo& args) { void ECDH::GetPublicKey(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); // Conversion form CHECK_EQ(args.Length(), 1); @@ -4287,7 +4169,6 @@ void ECDH::GetPublicKey(const FunctionCallbackInfo& args) { void ECDH::GetPrivateKey(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); ECDH* ecdh = Unwrap(args.Holder()); @@ -4315,7 +4196,6 @@ void ECDH::GetPrivateKey(const FunctionCallbackInfo& args) { void ECDH::SetPrivateKey(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); ECDH* ecdh = Unwrap(args.Holder()); @@ -4335,7 +4215,6 @@ void ECDH::SetPrivateKey(const FunctionCallbackInfo& args) { void ECDH::SetPublicKey(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); ECDH* ecdh = Unwrap(args.Holder()); @@ -4499,7 +4378,6 @@ void EIO_PBKDF2After(uv_work_t* work_req, int status) { void PBKDF2(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); const EVP_MD* digest = NULL; const char* type_error = NULL; @@ -4737,7 +4615,6 @@ void RandomBytesAfter(uv_work_t* work_req, int status) { template void RandomBytes(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); // maybe allow a buffer to write to? cuts down on object creation @@ -4780,7 +4657,6 @@ void RandomBytes(const FunctionCallbackInfo& args) { void GetSSLCiphers(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); SSL_CTX* ctx = SSL_CTX_new(TLSv1_server_method()); if (ctx == NULL) { @@ -4836,7 +4712,6 @@ static void array_push_back(const TypeName* md, void GetCiphers(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); CipherPushContext ctx(env); EVP_CIPHER_do_all_sorted(array_push_back, &ctx); args.GetReturnValue().Set(ctx.arr); @@ -4845,7 +4720,6 @@ void GetCiphers(const FunctionCallbackInfo& args) { void GetHashes(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); CipherPushContext ctx(env); EVP_MD_do_all_sorted(array_push_back, &ctx); args.GetReturnValue().Set(ctx.arr); @@ -4869,7 +4743,6 @@ void Certificate::Initialize(Environment* env, Handle target) { void Certificate::New(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); new Certificate(env, args.This()); } @@ -4902,8 +4775,6 @@ bool Certificate::VerifySpkac(const char* data, unsigned int len) { void Certificate::VerifySpkac(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); - Certificate* certificate = Unwrap(args.Holder()); Environment* env = certificate->env(); bool i = false; @@ -4969,7 +4840,6 @@ const char* Certificate::ExportPublicKey(const char* data, int len) { void Certificate::ExportPublicKey(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Certificate* certificate = Unwrap(args.Holder()); @@ -5013,7 +4883,6 @@ const char* Certificate::ExportChallenge(const char* data, int len) { void Certificate::ExportChallenge(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Certificate* crt = Unwrap(args.Holder()); diff --git a/src/node_dtrace.cc b/src/node_dtrace.cc index 6e5e31083f..ce31d483b0 100644 --- a/src/node_dtrace.cc +++ b/src/node_dtrace.cc @@ -148,7 +148,6 @@ void DTRACE_NET_SERVER_CONNECTION(const FunctionCallbackInfo& args) { if (!NODE_NET_SERVER_CONNECTION_ENABLED()) return; Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); SLURP_CONNECTION(args[0], conn); NODE_NET_SERVER_CONNECTION(&conn, conn.remote, conn.port, conn.fd); } @@ -158,7 +157,6 @@ void DTRACE_NET_STREAM_END(const FunctionCallbackInfo& args) { if (!NODE_NET_STREAM_END_ENABLED()) return; Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); SLURP_CONNECTION(args[0], conn); NODE_NET_STREAM_END(&conn, conn.remote, conn.port, conn.fd); } @@ -168,7 +166,6 @@ void DTRACE_NET_SOCKET_READ(const FunctionCallbackInfo& args) { if (!NODE_NET_SOCKET_READ_ENABLED()) return; Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); SLURP_CONNECTION(args[0], conn); if (!args[1]->IsNumber()) { @@ -184,7 +181,6 @@ void DTRACE_NET_SOCKET_WRITE(const FunctionCallbackInfo& args) { if (!NODE_NET_SOCKET_WRITE_ENABLED()) return; Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); SLURP_CONNECTION(args[0], conn); if (!args[1]->IsNumber()) { @@ -234,7 +230,6 @@ void DTRACE_HTTP_SERVER_RESPONSE(const FunctionCallbackInfo& args) { if (!NODE_HTTP_SERVER_RESPONSE_ENABLED()) return; Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); SLURP_CONNECTION(args[0], conn); NODE_HTTP_SERVER_RESPONSE(&conn, conn.remote, conn.port, conn.fd); } @@ -284,7 +279,6 @@ void DTRACE_HTTP_CLIENT_RESPONSE(const FunctionCallbackInfo& args) { if (!NODE_HTTP_CLIENT_RESPONSE_ENABLED()) return; Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); SLURP_CONNECTION_HTTP_CLIENT_RESPONSE(args[0], args[1], conn); NODE_HTTP_CLIENT_RESPONSE(&conn, conn.remote, conn.port, conn.fd); } diff --git a/src/node_file.cc b/src/node_file.cc index 8962f8680a..268fe4c916 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -313,7 +313,6 @@ struct fs_req_wrap { static void Close(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 1 || !args[0]->IsInt32()) { return THROW_BAD_ARGS; @@ -428,7 +427,6 @@ Local BuildStatsObject(Environment* env, const uv_stat_t* s) { static void Stat(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 1) return TYPE_ERROR("path required"); @@ -448,7 +446,6 @@ static void Stat(const FunctionCallbackInfo& args) { static void LStat(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 1) return TYPE_ERROR("path required"); @@ -468,7 +465,6 @@ static void LStat(const FunctionCallbackInfo& args) { static void FStat(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 1 || !args[0]->IsInt32()) { return THROW_BAD_ARGS; @@ -487,7 +483,6 @@ static void FStat(const FunctionCallbackInfo& args) { static void Symlink(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); int len = args.Length(); if (len < 1) @@ -523,7 +518,6 @@ static void Symlink(const FunctionCallbackInfo& args) { static void Link(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); int len = args.Length(); if (len < 1) @@ -547,7 +541,6 @@ static void Link(const FunctionCallbackInfo& args) { static void ReadLink(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 1) return TYPE_ERROR("path required"); @@ -568,7 +561,6 @@ static void ReadLink(const FunctionCallbackInfo& args) { static void Rename(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); int len = args.Length(); if (len < 1) @@ -592,7 +584,6 @@ static void Rename(const FunctionCallbackInfo& args) { static void FTruncate(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 2 || !args[0]->IsInt32()) { return THROW_BAD_ARGS; @@ -612,7 +603,6 @@ static void FTruncate(const FunctionCallbackInfo& args) { static void Fdatasync(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 1 || !args[0]->IsInt32()) { return THROW_BAD_ARGS; @@ -629,7 +619,6 @@ static void Fdatasync(const FunctionCallbackInfo& args) { static void Fsync(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 1 || !args[0]->IsInt32()) { return THROW_BAD_ARGS; @@ -646,7 +635,6 @@ static void Fsync(const FunctionCallbackInfo& args) { static void Unlink(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 1) return TYPE_ERROR("path required"); @@ -664,7 +652,6 @@ static void Unlink(const FunctionCallbackInfo& args) { static void RMDir(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 1) return TYPE_ERROR("path required"); @@ -682,7 +669,6 @@ static void RMDir(const FunctionCallbackInfo& args) { static void MKDir(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 2 || !args[0]->IsString() || !args[1]->IsInt32()) { return THROW_BAD_ARGS; @@ -700,7 +686,6 @@ static void MKDir(const FunctionCallbackInfo& args) { static void ReadDir(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 1) return TYPE_ERROR("path required"); @@ -738,7 +723,6 @@ static void ReadDir(const FunctionCallbackInfo& args) { static void Open(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); int len = args.Length(); if (len < 1) @@ -778,7 +762,6 @@ static void Open(const FunctionCallbackInfo& args) { // if null, write from the current position static void WriteBuffer(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); assert(args[0]->IsInt32()); assert(Buffer::HasInstance(args[1])); @@ -824,7 +807,6 @@ static void WriteBuffer(const FunctionCallbackInfo& args) { // if null, write from the current position // 3 enc encoding of string static void WriteString(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); if (!args[0]->IsInt32()) @@ -898,7 +880,6 @@ static void WriteString(const FunctionCallbackInfo& args) { */ static void Read(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 2 || !args[0]->IsInt32()) { return THROW_BAD_ARGS; @@ -952,7 +933,6 @@ static void Read(const FunctionCallbackInfo& args) { */ static void Chmod(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 2 || !args[0]->IsString() || !args[1]->IsInt32()) { return THROW_BAD_ARGS; @@ -973,7 +953,6 @@ static void Chmod(const FunctionCallbackInfo& args) { */ static void FChmod(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (args.Length() < 2 || !args[0]->IsInt32() || !args[1]->IsInt32()) { return THROW_BAD_ARGS; @@ -994,7 +973,6 @@ static void FChmod(const FunctionCallbackInfo& args) { */ static void Chown(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); int len = args.Length(); if (len < 1) @@ -1027,7 +1005,6 @@ static void Chown(const FunctionCallbackInfo& args) { */ static void FChown(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); int len = args.Length(); if (len < 1) @@ -1057,7 +1034,6 @@ static void FChown(const FunctionCallbackInfo& args) { static void UTimes(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); int len = args.Length(); if (len < 1) @@ -1086,7 +1062,6 @@ static void UTimes(const FunctionCallbackInfo& args) { static void FUTimes(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); int len = args.Length(); if (len < 1) diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index 8d9b66ed06..49e19290dc 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -350,7 +350,6 @@ class Parser : public BaseObject { static void New(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); http_parser_type type = static_cast(args[0]->Int32Value()); @@ -360,7 +359,6 @@ class Parser : public BaseObject { static void Close(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Parser* parser = Unwrap(args.Holder()); delete parser; } @@ -382,7 +380,6 @@ class Parser : public BaseObject { // var bytesParsed = parser->execute(buffer); static void Execute(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); Parser* parser = Unwrap(args.Holder()); @@ -438,7 +435,6 @@ class Parser : public BaseObject { static void Finish(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Parser* parser = Unwrap(args.Holder()); @@ -465,7 +461,6 @@ class Parser : public BaseObject { static void Reinitialize(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); http_parser_type type = @@ -481,7 +476,6 @@ class Parser : public BaseObject { template static void Pause(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); Parser* parser = Unwrap(args.Holder()); // Should always be called from the same context. diff --git a/src/node_os.cc b/src/node_os.cc index a7041aed7a..4d8dc5c31d 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -51,7 +51,6 @@ using v8::Array; using v8::Context; using v8::FunctionCallbackInfo; using v8::Handle; -using v8::HandleScope; using v8::Integer; using v8::Local; using v8::Number; @@ -62,7 +61,6 @@ using v8::Value; static void GetEndianness(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); const char* rval = IsBigEndian() ? "BE" : "LE"; args.GetReturnValue().Set(OneByteString(env->isolate(), rval)); } @@ -70,7 +68,6 @@ static void GetEndianness(const FunctionCallbackInfo& args) { static void GetHostname(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); char buf[MAXHOSTNAMELEN + 1]; if (gethostname(buf, sizeof(buf))) { @@ -89,7 +86,6 @@ static void GetHostname(const FunctionCallbackInfo& args) { static void GetOSType(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); const char* rval; #ifdef __POSIX__ @@ -108,7 +104,6 @@ static void GetOSType(const FunctionCallbackInfo& args) { static void GetOSRelease(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); const char* rval; #ifdef __POSIX__ @@ -140,7 +135,6 @@ static void GetOSRelease(const FunctionCallbackInfo& args) { static void GetCPUInfo(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); uv_cpu_info_t* cpu_infos; int count, i; @@ -180,8 +174,6 @@ static void GetCPUInfo(const FunctionCallbackInfo& args) { static void GetFreeMemory(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); double amount = uv_get_free_memory(); if (amount < 0) return; @@ -190,8 +182,6 @@ static void GetFreeMemory(const FunctionCallbackInfo& args) { static void GetTotalMemory(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); double amount = uv_get_total_memory(); if (amount < 0) return; @@ -200,8 +190,6 @@ static void GetTotalMemory(const FunctionCallbackInfo& args) { static void GetUptime(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); double uptime; int err = uv_uptime(&uptime); if (err == 0) @@ -211,7 +199,6 @@ static void GetUptime(const FunctionCallbackInfo& args) { static void GetLoadAvg(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); double loadavg[3]; uv_loadavg(loadavg); Local loads = Array::New(env->isolate(), 3); @@ -224,7 +211,6 @@ static void GetLoadAvg(const FunctionCallbackInfo& args) { static void GetInterfaceAddresses(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); uv_interface_address_t* interfaces; int count, i; char ip[INET6_ADDRSTRLEN]; diff --git a/src/node_stat_watcher.cc b/src/node_stat_watcher.cc index aaaa1a3cdb..1c3b55a041 100644 --- a/src/node_stat_watcher.cc +++ b/src/node_stat_watcher.cc @@ -101,7 +101,6 @@ void StatWatcher::Callback(uv_fs_poll_t* handle, void StatWatcher::New(const FunctionCallbackInfo& args) { assert(args.IsConstructCall()); - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); new StatWatcher(env, args.This()); } @@ -109,8 +108,6 @@ void StatWatcher::New(const FunctionCallbackInfo& args) { void StatWatcher::Start(const FunctionCallbackInfo& args) { assert(args.Length() == 3); - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); StatWatcher* wrap = Unwrap(args.Holder()); node::Utf8Value path(args[0]); @@ -127,7 +124,6 @@ void StatWatcher::Start(const FunctionCallbackInfo& args) { void StatWatcher::Stop(const FunctionCallbackInfo& args) { StatWatcher* wrap = Unwrap(args.Holder()); Environment* env = wrap->env(); - HandleScope handle_scope(env->isolate()); Context::Scope context_scope(env->context()); wrap->MakeCallback(env->onstop_string(), 0, NULL); wrap->Stop(); diff --git a/src/node_v8.cc b/src/node_v8.cc index b71b2a384d..0c7d5f3ebd 100644 --- a/src/node_v8.cc +++ b/src/node_v8.cc @@ -173,7 +173,6 @@ void Environment::StopGarbageCollectionTracking() { void StartGarbageCollectionTracking(const FunctionCallbackInfo& args) { CHECK(args[0]->IsFunction() == true); - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); env->StartGarbageCollectionTracking(args[0].As()); } @@ -181,7 +180,6 @@ void StartGarbageCollectionTracking(const FunctionCallbackInfo& args) { void GetHeapStatistics(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); - HandleScope handle_scope(isolate); Environment* env = Environment::GetCurrent(isolate); HeapStatistics s; isolate->GetHeapStatistics(&s); @@ -202,7 +200,6 @@ void GetHeapStatistics(const FunctionCallbackInfo& args) { void StopGarbageCollectionTracking(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment::GetCurrent(args.GetIsolate())->StopGarbageCollectionTracking(); } diff --git a/src/node_zlib.cc b/src/node_zlib.cc index 4f0c938998..4a0161dcb6 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -128,8 +128,6 @@ class ZCtx : public AsyncWrap { static void Close(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); ZCtx* ctx = Unwrap(args.Holder()); ctx->Close(); } @@ -138,8 +136,6 @@ class ZCtx : public AsyncWrap { // write(flush, in, in_off, in_len, out, out_off, out_len) template static void Write(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); assert(args.Length() == 7); ZCtx* ctx = Unwrap(args.Holder()); @@ -224,7 +220,6 @@ class ZCtx : public AsyncWrap { static void AfterSync(ZCtx* ctx, const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Local avail_out = Integer::New(env->isolate(), ctx->strm_.avail_out); Local avail_in = Integer::New(env->isolate(), @@ -370,7 +365,6 @@ class ZCtx : public AsyncWrap { } static void New(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); if (args.Length() < 1 || !args[0]->IsInt32()) { @@ -388,7 +382,6 @@ class ZCtx : public AsyncWrap { // just pull the ints out of the args and call the other Init static void Init(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); assert((args.Length() == 4 || args.Length() == 5) && "init(windowBits, level, memLevel, strategy, [dictionary])"); @@ -429,7 +422,6 @@ class ZCtx : public AsyncWrap { static void Params(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); assert(args.Length() == 2 && "params(level, strategy)"); @@ -440,7 +432,6 @@ class ZCtx : public AsyncWrap { static void Reset(const FunctionCallbackInfo &args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); ZCtx* ctx = Unwrap(args.Holder()); diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index 05472de5d9..49d09f43fb 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -127,7 +127,6 @@ void PipeWrap::New(const FunctionCallbackInfo& args) { // Therefore we assert that we are not trying to call this as a // normal function. assert(args.IsConstructCall()); - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); new PipeWrap(env, args.This(), args[0]->IsTrue()); } @@ -146,11 +145,7 @@ PipeWrap::PipeWrap(Environment* env, Handle object, bool ipc) void PipeWrap::Bind(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - PipeWrap* wrap = Unwrap(args.Holder()); - node::Utf8Value name(args[0]); int err = uv_pipe_bind(&wrap->handle_, *name); args.GetReturnValue().Set(err); @@ -159,24 +154,15 @@ void PipeWrap::Bind(const FunctionCallbackInfo& args) { #ifdef _WIN32 void PipeWrap::SetPendingInstances(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - PipeWrap* wrap = Unwrap(args.Holder()); - int instances = args[0]->Int32Value(); - uv_pipe_pending_instances(&wrap->handle_, instances); } #endif void PipeWrap::Listen(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - PipeWrap* wrap = Unwrap(args.Holder()); - int backlog = args[0]->Int32Value(); int err = uv_listen(reinterpret_cast(&wrap->handle_), backlog, @@ -262,7 +248,6 @@ void PipeWrap::AfterConnect(uv_connect_t* req, int status) { void PipeWrap::Open(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); PipeWrap* wrap = Unwrap(args.Holder()); @@ -276,7 +261,6 @@ void PipeWrap::Open(const FunctionCallbackInfo& args) { void PipeWrap::Connect(const FunctionCallbackInfo& args) { - HandleScope scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); PipeWrap* wrap = Unwrap(args.Holder()); diff --git a/src/process_wrap.cc b/src/process_wrap.cc index a270c38843..42afea0f20 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -74,7 +74,6 @@ class ProcessWrap : public HandleWrap { // Therefore we assert that we are not trying to call this as a // normal function. assert(args.IsConstructCall()); - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); new ProcessWrap(env, args.This()); } @@ -131,7 +130,6 @@ class ProcessWrap : public HandleWrap { } static void Spawn(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); ProcessWrap* wrap = Unwrap(args.Holder()); @@ -254,10 +252,7 @@ class ProcessWrap : public HandleWrap { } static void Kill(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); ProcessWrap* wrap = Unwrap(args.Holder()); - int signal = args[0]->Int32Value(); int err = uv_process_kill(&wrap->process_, signal); args.GetReturnValue().Set(err); diff --git a/src/signal_wrap.cc b/src/signal_wrap.cc index a50340d511..0c814358f3 100644 --- a/src/signal_wrap.cc +++ b/src/signal_wrap.cc @@ -68,7 +68,6 @@ class SignalWrap : public HandleWrap { // Therefore we assert that we are not trying to call this as a // normal function. assert(args.IsConstructCall()); - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); new SignalWrap(env, args.This()); } @@ -86,20 +85,14 @@ class SignalWrap : public HandleWrap { } static void Start(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); SignalWrap* wrap = Unwrap(args.Holder()); - int signum = args[0]->Int32Value(); int err = uv_signal_start(&wrap->handle_, OnSignal, signum); args.GetReturnValue().Set(err); } static void Stop(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); SignalWrap* wrap = Unwrap(args.Holder()); - int err = uv_signal_stop(&wrap->handle_); args.GetReturnValue().Set(err); } diff --git a/src/smalloc.cc b/src/smalloc.cc index 41298030ce..b1e9766430 100644 --- a/src/smalloc.cc +++ b/src/smalloc.cc @@ -173,7 +173,6 @@ size_t ExternalArraySize(enum ExternalArrayType type) { // copyOnto(source, source_start, dest, dest_start, copy_length) void CopyOnto(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); if (!args[0]->IsObject()) return env->ThrowTypeError("source must be an object"); @@ -249,9 +248,6 @@ void CopyOnto(const FunctionCallbackInfo& args) { // for internal use: // dest._data = sliceOnto(source, dest, start, end); void SliceOnto(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - Local source = args[0].As(); Local dest = args[1].As(); @@ -291,7 +287,6 @@ void SliceOnto(const FunctionCallbackInfo& args) { // alloc(obj, n[, type]); void Alloc(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Local obj = args[0].As(); @@ -449,7 +444,6 @@ bool HasExternalData(Environment* env, Local obj) { void AllocTruncate(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Local obj = args[0].As(); diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index 59de8d4630..67ec98ba03 100644 --- a/src/spawn_sync.cc +++ b/src/spawn_sync.cc @@ -362,7 +362,6 @@ void SyncProcessRunner::Initialize(Handle target, void SyncProcessRunner::Spawn(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); SyncProcessRunner p(Environment::GetCurrent(isolate)); Local result = p.Run(args[0]); args.GetReturnValue().Set(result); diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index fe3e82799d..3c7fb3388f 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -90,23 +90,14 @@ void StreamWrap::UpdateWriteQueueSize() { } void StreamWrap::ReadStart(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - StreamWrap* wrap = Unwrap(args.Holder()); - int err = uv_read_start(wrap->stream(), OnAlloc, OnRead); - args.GetReturnValue().Set(err); } void StreamWrap::ReadStop(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - StreamWrap* wrap = Unwrap(args.Holder()); - int err = uv_read_stop(wrap->stream()); args.GetReturnValue().Set(err); } @@ -190,7 +181,6 @@ size_t StreamWrap::WriteBuffer(Handle val, uv_buf_t* buf) { void StreamWrap::WriteBuffer(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); StreamWrap* wrap = Unwrap(args.Holder()); @@ -247,7 +237,6 @@ void StreamWrap::WriteBuffer(const FunctionCallbackInfo& args) { template void StreamWrap::WriteStringImpl(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); int err; @@ -376,7 +365,6 @@ void StreamWrap::WriteStringImpl(const FunctionCallbackInfo& args) { void StreamWrap::Writev(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); StreamWrap* wrap = Unwrap(args.Holder()); @@ -505,14 +493,9 @@ void StreamWrap::WriteBinaryString(const FunctionCallbackInfo& args) { } void StreamWrap::SetBlocking(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - StreamWrap* wrap = Unwrap(args.Holder()); - assert(args.Length() > 0); int err = uv_stream_set_blocking(wrap->stream(), args[0]->IsTrue()); - args.GetReturnValue().Set(err); } @@ -552,7 +535,6 @@ void StreamWrap::AfterWrite(uv_write_t* req, int status) { void StreamWrap::Shutdown(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); StreamWrap* wrap = Unwrap(args.Holder()); diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index 09671d0095..13ec66f9a2 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -148,7 +148,6 @@ void TCPWrap::New(const FunctionCallbackInfo& args) { // Therefore we assert that we are not trying to call this as a // normal function. assert(args.IsConstructCall()); - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); TCPWrap* wrap = new TCPWrap(env, args.This()); assert(wrap); @@ -173,7 +172,6 @@ TCPWrap::~TCPWrap() { void TCPWrap::GetSockName(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); struct sockaddr_storage address; @@ -196,7 +194,6 @@ void TCPWrap::GetSockName(const FunctionCallbackInfo& args) { void TCPWrap::GetPeerName(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); struct sockaddr_storage address; @@ -219,11 +216,7 @@ void TCPWrap::GetPeerName(const FunctionCallbackInfo& args) { void TCPWrap::SetNoDelay(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - TCPWrap* wrap = Unwrap(args.Holder()); - int enable = static_cast(args[0]->BooleanValue()); int err = uv_tcp_nodelay(&wrap->handle_, enable); args.GetReturnValue().Set(err); @@ -231,14 +224,9 @@ void TCPWrap::SetNoDelay(const FunctionCallbackInfo& args) { void TCPWrap::SetKeepAlive(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - TCPWrap* wrap = Unwrap(args.Holder()); - int enable = args[0]->Int32Value(); unsigned int delay = args[1]->Uint32Value(); - int err = uv_tcp_keepalive(&wrap->handle_, enable, delay); args.GetReturnValue().Set(err); } @@ -246,11 +234,7 @@ void TCPWrap::SetKeepAlive(const FunctionCallbackInfo& args) { #ifdef _WIN32 void TCPWrap::SetSimultaneousAccepts(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - TCPWrap* wrap = Unwrap(args.Holder()); - bool enable = args[0]->BooleanValue(); int err = uv_tcp_simultaneous_accepts(&wrap->handle_, enable); args.GetReturnValue().Set(err); @@ -259,8 +243,6 @@ void TCPWrap::SetSimultaneousAccepts(const FunctionCallbackInfo& args) { void TCPWrap::Open(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); TCPWrap* wrap = Unwrap(args.Holder()); int fd = static_cast(args[0]->IntegerValue()); uv_tcp_open(&wrap->handle_, fd); @@ -268,14 +250,9 @@ void TCPWrap::Open(const FunctionCallbackInfo& args) { void TCPWrap::Bind(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - TCPWrap* wrap = Unwrap(args.Holder()); - node::Utf8Value ip_address(args[0]); int port = args[1]->Int32Value(); - sockaddr_in addr; int err = uv_ip4_addr(*ip_address, port, &addr); if (err == 0) { @@ -283,20 +260,14 @@ void TCPWrap::Bind(const FunctionCallbackInfo& args) { reinterpret_cast(&addr), 0); } - args.GetReturnValue().Set(err); } void TCPWrap::Bind6(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - TCPWrap* wrap = Unwrap(args.Holder()); - node::Utf8Value ip6_address(args[0]); int port = args[1]->Int32Value(); - sockaddr_in6 addr; int err = uv_ip6_addr(*ip6_address, port, &addr); if (err == 0) { @@ -304,17 +275,12 @@ void TCPWrap::Bind6(const FunctionCallbackInfo& args) { reinterpret_cast(&addr), 0); } - args.GetReturnValue().Set(err); } void TCPWrap::Listen(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - TCPWrap* wrap = Unwrap(args.Holder()); - int backlog = args[0]->Int32Value(); int err = uv_listen(reinterpret_cast(&wrap->handle_), backlog, @@ -387,7 +353,6 @@ void TCPWrap::AfterConnect(uv_connect_t* req, int status) { void TCPWrap::Connect(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); TCPWrap* wrap = Unwrap(args.Holder()); @@ -421,7 +386,6 @@ void TCPWrap::Connect(const FunctionCallbackInfo& args) { void TCPWrap::Connect6(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); TCPWrap* wrap = Unwrap(args.Holder()); diff --git a/src/timer_wrap.cc b/src/timer_wrap.cc index 71e6a61343..63058b1f0a 100644 --- a/src/timer_wrap.cc +++ b/src/timer_wrap.cc @@ -79,7 +79,6 @@ class TimerWrap : public HandleWrap { // Therefore we assert that we are not trying to call this as a // normal function. assert(args.IsConstructCall()); - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); new TimerWrap(env, args.This()); } diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index ac05c8ecac..9006fcf8bd 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -206,7 +206,6 @@ void TLSCallbacks::InitSSL() { void TLSCallbacks::Wrap(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); if (args.Length() < 1 || !args[0]->IsObject()) { @@ -240,8 +239,6 @@ void TLSCallbacks::Wrap(const FunctionCallbackInfo& args) { void TLSCallbacks::Receive(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); - TLSCallbacks* wrap = Unwrap(args.Holder()); CHECK(Buffer::HasInstance(args[0])); @@ -267,7 +264,6 @@ void TLSCallbacks::Receive(const FunctionCallbackInfo& args) { void TLSCallbacks::Start(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); TLSCallbacks* wrap = Unwrap(args.Holder()); @@ -685,7 +681,6 @@ int TLSCallbacks::DoShutdown(ShutdownWrap* req_wrap, uv_shutdown_cb cb) { void TLSCallbacks::SetVerifyMode(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); TLSCallbacks* wrap = Unwrap(args.Holder()); @@ -716,22 +711,14 @@ void TLSCallbacks::SetVerifyMode(const FunctionCallbackInfo& args) { void TLSCallbacks::EnableSessionCallbacks( const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - TLSCallbacks* wrap = Unwrap(args.Holder()); - wrap->enable_session_callbacks(); EnableHelloParser(args); } void TLSCallbacks::EnableHelloParser(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - TLSCallbacks* wrap = Unwrap(args.Holder()); - NodeBIO::FromBIO(wrap->enc_in_)->set_initial(kMaxHelloLength); wrap->hello_parser_.Start(SSLWrap::OnClientHello, OnClientHelloParseEnd, @@ -748,7 +735,6 @@ void TLSCallbacks::OnClientHelloParseEnd(void* arg) { #ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB void TLSCallbacks::GetServername(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); TLSCallbacks* wrap = Unwrap(args.Holder()); @@ -764,7 +750,6 @@ void TLSCallbacks::GetServername(const FunctionCallbackInfo& args) { void TLSCallbacks::SetServername(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); TLSCallbacks* wrap = Unwrap(args.Holder()); diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index 34ee14dec7..ec4ad82a72 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -39,7 +39,6 @@ using v8::Function; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; using v8::Handle; -using v8::HandleScope; using v8::Integer; using v8::Local; using v8::Object; @@ -100,7 +99,6 @@ uv_tty_t* TTYWrap::UVHandle() { void TTYWrap::GuessHandleType(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); int fd = args[0]->Int32Value(); assert(fd >= 0); @@ -123,8 +121,6 @@ void TTYWrap::GuessHandleType(const FunctionCallbackInfo& args) { void TTYWrap::IsTTY(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); int fd = args[0]->Int32Value(); assert(fd >= 0); bool rc = uv_guess_handle(fd) == UV_TTY; @@ -134,7 +130,6 @@ void TTYWrap::IsTTY(const FunctionCallbackInfo& args) { void TTYWrap::GetWindowSize(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); TTYWrap* wrap = Unwrap(args.Holder()); assert(args[0]->IsArray()); @@ -153,18 +148,13 @@ void TTYWrap::GetWindowSize(const FunctionCallbackInfo& args) { void TTYWrap::SetRawMode(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - TTYWrap* wrap = Unwrap(args.Holder()); - int err = uv_tty_set_mode(&wrap->handle_, args[0]->IsTrue()); args.GetReturnValue().Set(err); } void TTYWrap::New(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); // This constructor should not be exposed to public javascript. diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index f0d4913339..1873b2ac18 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -129,7 +129,6 @@ void UDPWrap::Initialize(Handle target, void UDPWrap::New(const FunctionCallbackInfo& args) { assert(args.IsConstructCall()); - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); new UDPWrap(env, args.This()); } @@ -147,9 +146,6 @@ void UDPWrap::GetFD(Local, const PropertyCallbackInfo& args) { void UDPWrap::DoBind(const FunctionCallbackInfo& args, int family) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); - UDPWrap* wrap = Unwrap(args.Holder()); // bind(ip, port, flags) @@ -195,7 +191,6 @@ void UDPWrap::Bind6(const FunctionCallbackInfo& args) { #define X(name, fn) \ void UDPWrap::name(const FunctionCallbackInfo& args) { \ - HandleScope scope(args.GetIsolate()); \ UDPWrap* wrap = Unwrap(args.Holder()); \ assert(args.Length() == 1); \ int flag = args[0]->Int32Value(); \ @@ -213,8 +208,6 @@ X(SetMulticastLoopback, uv_udp_set_multicast_loop) void UDPWrap::SetMembership(const FunctionCallbackInfo& args, uv_membership membership) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); UDPWrap* wrap = Unwrap(args.Holder()); assert(args.Length() == 2); @@ -246,7 +239,6 @@ void UDPWrap::DropMembership(const FunctionCallbackInfo& args) { void UDPWrap::DoSend(const FunctionCallbackInfo& args, int family) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); UDPWrap* wrap = Unwrap(args.Holder()); @@ -317,10 +309,7 @@ void UDPWrap::Send6(const FunctionCallbackInfo& args) { void UDPWrap::RecvStart(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); UDPWrap* wrap = Unwrap(args.Holder()); - int err = uv_udp_recv_start(&wrap->handle_, OnAlloc, OnRecv); // UV_EALREADY means that the socket is already bound but that's okay if (err == UV_EALREADY) @@ -330,17 +319,13 @@ void UDPWrap::RecvStart(const FunctionCallbackInfo& args) { void UDPWrap::RecvStop(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); UDPWrap* wrap = Unwrap(args.Holder()); - int r = uv_udp_recv_stop(&wrap->handle_); args.GetReturnValue().Set(r); } void UDPWrap::GetSockName(const FunctionCallbackInfo& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); struct sockaddr_storage address; diff --git a/src/uv.cc b/src/uv.cc index 54bbf92f12..de99b6e66d 100644 --- a/src/uv.cc +++ b/src/uv.cc @@ -31,7 +31,6 @@ using v8::Context; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; using v8::Handle; -using v8::HandleScope; using v8::Integer; using v8::Object; using v8::String; @@ -40,7 +39,6 @@ using v8::Value; void ErrName(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); int err = args[0]->Int32Value(); if (err >= 0) return env->ThrowError("err >= 0");