summaryrefslogtreecommitdiff
path: root/src/cares_wrap.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-11-11 10:53:00 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2013-11-12 22:06:48 +0100
commit27f115d715478b9a800927498ba606d4a62f927c (patch)
tree2a1c5b790d852f48f5547a72fa4e90ea146e004d /src/cares_wrap.cc
parentc0d62c207ee67492619bde4af46502b5a3ce6a66 (diff)
downloadnode-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.cc8
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),