Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarshitha KP <harshi46@in.ibm.com>2020-02-25 10:46:16 +0300
committerGireesh Punathil <gpunathi@in.ibm.com>2020-03-05 10:00:29 +0300
commit757e2037e74fecca521c664fc8486596b306de39 (patch)
tree222edb0ef0ed076fb0412155326f2538e67d87f7 /src/async_wrap-inl.h
parentcb8898c48feac55ef49b1594d7a4131e827c213e (diff)
src: Handle bad callback in asyc_wrap
Align with the MaybeLocal<> API contract PR-URL: https://github.com/nodejs/node/pull/31946 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/async_wrap-inl.h')
-rw-r--r--src/async_wrap-inl.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/async_wrap-inl.h b/src/async_wrap-inl.h
index e3e48666e4f..03745081f3b 100644
--- a/src/async_wrap-inl.h
+++ b/src/async_wrap-inl.h
@@ -74,9 +74,8 @@ inline v8::MaybeLocal<v8::Value> AsyncWrap::MakeCallback(
if (!object()->Get(env()->context(), symbol).ToLocal(&cb_v))
return v8::MaybeLocal<v8::Value>();
if (!cb_v->IsFunction()) {
- // TODO(addaleax): We should throw an error here to fulfill the
- // `MaybeLocal<>` API contract.
- return v8::MaybeLocal<v8::Value>();
+ v8::Isolate* isolate = env()->isolate();
+ return Undefined(isolate);
}
return MakeCallback(cb_v.As<v8::Function>(), argc, argv);
}