Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ inline std::string tracingCategoryToString(const Category &category)
return "disabled-by-default-devtools.screenshot";
default:
folly::assume_unreachable();
return "unknown";
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -858,11 +858,10 @@ TEST_P(RuntimeSchedulerTest, scheduleTaskFromTask) {

TEST_P(RuntimeSchedulerTest, handlingError) {
bool didRunTask = false;
auto firstCallback =
createHostFunctionFromLambda([this, &didRunTask](bool /*unused*/) {
auto firstCallback = createHostFunctionFromLambda(
[this, &didRunTask](bool /*unused*/) -> jsi::Value {
didRunTask = true;
throw jsi::JSError(*runtime_, "Test error");
return jsi::Value::undefined();
});

runtimeScheduler_->scheduleTask(
Expand Down Expand Up @@ -1169,27 +1168,26 @@ TEST_P(RuntimeSchedulerTest, errorInTaskShouldNotStopMicrotasks) {
auto microtaskRan = false;
auto taskRan = false;

auto callback = createHostFunctionFromLambda([&](bool /* unused */) {
taskRan = true;

auto microtaskCallback = jsi::Function::createFromHostFunction(
*runtime_,
jsi::PropNameID::forUtf8(*runtime_, "microtask1"),
3,
[&](jsi::Runtime& /*unused*/,
const jsi::Value& /*unused*/,
const jsi::Value* /*arguments*/,
size_t /*unused*/) -> jsi::Value {
microtaskRan = true;
return jsi::Value::undefined();
});

runtime_->queueMicrotask(microtaskCallback);
auto callback =
createHostFunctionFromLambda([&](bool /* unused */) -> jsi::Value {
taskRan = true;

auto microtaskCallback = jsi::Function::createFromHostFunction(
*runtime_,
jsi::PropNameID::forUtf8(*runtime_, "microtask1"),
3,
[&](jsi::Runtime& /*unused*/,
const jsi::Value& /*unused*/,
const jsi::Value* /*arguments*/,
size_t /*unused*/) -> jsi::Value {
microtaskRan = true;
return jsi::Value::undefined();
});

throw jsi::JSError(*runtime_, "Test error");
runtime_->queueMicrotask(microtaskCallback);

return jsi::Value::undefined();
});
throw jsi::JSError(*runtime_, "Test error");
});

runtimeScheduler_->scheduleTask(
SchedulerPriority::NormalPriority, std::move(callback));
Expand Down