Skip to content

Commit a038492

Browse files
committed
chore: Ignore main thread and frame callback return values
We don't do anything with the return value from these callbacks, so it's OK to ignore them and not convert them to a local handle.
1 parent 05c7897 commit a038492

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

test-app/runtime/src/main/cpp/CallbackHandlers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ int CallbackHandlers::RunOnMainThreadFdCallback(int fd, int events, void *data)
704704

705705
v8::TryCatch tc(isolate);
706706

707-
if (!cb->Call(context, context->Global(), 0, nullptr).ToLocal(&result)) {}
707+
cb->Call(context, context->Global(), 0, nullptr); // ignore JS return value
708708

709709
cache_.erase(it);
710710

test-app/runtime/src/main/cpp/CallbackHandlers.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,7 @@ namespace tns {
368368

369369
v8::TryCatch tc(isolate);
370370

371-
if (!cb->Call(context, context->Global(), 1, args).ToLocal(&result)) {
372-
// TODO
373-
}
371+
cb->Call(context, context->Global(), 1, args); // ignore JS return value
374372

375373
frameCallbackCache_.erase(entry->id); // invalidates *entry
376374

0 commit comments

Comments
 (0)