diff --git a/src/node_dns.cc b/src/node_dns.cc index 8bf78f6684..d26913d96d 100644 --- a/src/node_dns.cc +++ b/src/node_dns.cc @@ -86,7 +86,13 @@ static void ResolveError(Handle *cb) { Local obj = e->ToObject(); obj->Set(errno_symbol, Integer::New(status)); + TryCatch try_catch; + (*cb)->Call(Context::GetCurrent()->Global(), 1, &e); + + if (try_catch.HasCaught()) { + FatalException(try_catch); + } } static void AfterResolveA4(struct dns_ctx *ctx, @@ -121,11 +127,11 @@ static void AfterResolveA4(struct dns_ctx *ctx, addresses->Set(Integer::New(i), address); } - Local argv[3] = { addresses, ttl, cname }; + Local argv[4] = { Local::New(Null()), addresses, ttl, cname }; TryCatch try_catch; - (*cb)->Call(Context::GetCurrent()->Global(), 3, argv); + (*cb)->Call(Context::GetCurrent()->Global(), 4, argv); if (try_catch.HasCaught()) { FatalException(try_catch); @@ -166,11 +172,11 @@ static void AfterResolveA6(struct dns_ctx *ctx, addresses->Set(Integer::New(i), address); } - Local argv[3] = { addresses, ttl, cname }; + Local argv[4] = { Local::New(Null()), addresses, ttl, cname }; TryCatch try_catch; - (*cb)->Call(Context::GetCurrent()->Global(), 3, argv); + (*cb)->Call(Context::GetCurrent()->Global(), 4, argv); if (try_catch.HasCaught()) { FatalException(try_catch); @@ -213,11 +219,11 @@ static void AfterResolveMX(struct dns_ctx *ctx, exchanges->Set(Integer::New(i), exchange); } - Local argv[3] = { exchanges, ttl, cname }; + Local argv[4] = { Local::New(Null()), exchanges, ttl, cname }; TryCatch try_catch; - (*cb)->Call(Context::GetCurrent()->Global(), 3, argv); + (*cb)->Call(Context::GetCurrent()->Global(), 4, argv); if (try_catch.HasCaught()) { FatalException(try_catch); @@ -256,11 +262,11 @@ static void AfterResolveTXT(struct dns_ctx *ctx, records->Set(Integer::New(i), String::New(txt)); } - Local argv[3] = { records, ttl, cname }; + Local argv[4] = { Local::New(Null()), records, ttl, cname }; TryCatch try_catch; - (*cb)->Call(Context::GetCurrent()->Global(), 3, argv); + (*cb)->Call(Context::GetCurrent()->Global(), 4, argv); if (try_catch.HasCaught()) { FatalException(try_catch); @@ -305,11 +311,11 @@ static void AfterResolveSRV(struct dns_ctx *ctx, records->Set(Integer::New(i), record); } - Local argv[3] = { records, ttl, cname }; + Local argv[4] = { Local::New(Null()), records, ttl, cname }; TryCatch try_catch; - (*cb)->Call(Context::GetCurrent()->Global(), 3, argv); + (*cb)->Call(Context::GetCurrent()->Global(), 4, argv); if (try_catch.HasCaught()) { FatalException(try_catch); @@ -411,11 +417,11 @@ static void AfterReverse(struct dns_ctx *ctx, domains->Set(Integer::New(i), domain); } - Local argv[3] = { domains, ttl, cname }; + Local argv[4] = { Local::New(Null()), domains, ttl, cname }; TryCatch try_catch; - (*cb)->Call(Context::GetCurrent()->Global(), 3, argv); + (*cb)->Call(Context::GetCurrent()->Global(), 4, argv); if (try_catch.HasCaught()) { FatalException(try_catch);