diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2013-11-11 10:53:00 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-11-12 22:06:48 +0100 |
commit | 27f115d715478b9a800927498ba606d4a62f927c (patch) | |
tree | 2a1c5b790d852f48f5547a72fa4e90ea146e004d /src/cares_wrap.cc | |
parent | c0d62c207ee67492619bde4af46502b5a3ce6a66 (diff) | |
download | node-new-27f115d715478b9a800927498ba606d4a62f927c.tar.gz |
src: fix Context::Scope usage
env->context() may or may not create a new Local. It currently does
not but don't depend on that behavior, create a HandleScope first.
Diffstat (limited to 'src/cares_wrap.cc')
-rw-r--r-- | src/cares_wrap.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 8145c595a5..5cc19f48fb 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -276,8 +276,8 @@ class QueryWrap : public AsyncWrap { } void CallOnComplete(Local<Value> answer) { - Context::Scope context_scope(env()->context()); HandleScope handle_scope(env()->isolate()); + Context::Scope context_scope(env()->context()); Local<Value> argv[] = { Integer::New(0, env()->isolate()), answer @@ -286,8 +286,8 @@ class QueryWrap : public AsyncWrap { } void CallOnComplete(Local<Value> answer, Local<Value> family) { - Context::Scope context_scope(env()->context()); HandleScope handle_scope(env()->isolate()); + Context::Scope context_scope(env()->context()); Local<Value> argv[] = { Integer::New(0, env()->isolate()), answer, @@ -298,8 +298,8 @@ class QueryWrap : public AsyncWrap { void ParseError(int status) { assert(status != ARES_SUCCESS); - Context::Scope context_scope(env()->context()); HandleScope handle_scope(env()->isolate()); + Context::Scope context_scope(env()->context()); Local<Value> arg; switch (status) { #define V(code) \ @@ -800,8 +800,8 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { GetAddrInfoReqWrap* req_wrap = static_cast<GetAddrInfoReqWrap*>(req->data); Environment* env = req_wrap->env(); - Context::Scope context_scope(env->context()); HandleScope handle_scope(env->isolate()); + Context::Scope context_scope(env->context()); Local<Value> argv[] = { Integer::New(status, node_isolate), |