Skip to content

Commit bca974b

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 bca974b

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,11 +700,10 @@ int CallbackHandlers::RunOnMainThreadFdCallback(int fd, int events, void *data)
700700
auto context = it->second.context_.Get(isolate);
701701
Context::Scope context_scope(context);
702702
Local<v8::Function> cb = it->second.callback_.Get(isolate);
703-
Local<Value> result;
704703

705704
v8::TryCatch tc(isolate);
706705

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

709708
cache_.erase(it);
710709

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,15 +362,11 @@ namespace tns {
362362
v8::Context::Scope context_scope(context);
363363

364364
v8::Local<v8::Function> cb = entry->callback_.Get(isolate);
365-
v8::Local<v8::Value> result;
366-
367365
v8::Local<v8::Value> args[1] = {v8::Number::New(isolate, ts)};
368366

369367
v8::TryCatch tc(isolate);
370368

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

375371
frameCallbackCache_.erase(entry->id); // invalidates *entry
376372

0 commit comments

Comments
 (0)