mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Fixing unreachable-code-return in react-native-github (#56338)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56338 ## Changelog: [iOS] [Fixed] - Addressed -Wunreachable-code-return violations Reviewed By: NickGerleman Differential Revision: D97797196 fbshipit-source-id: 0a7a34d69fb4592094bbcbae5d56bc848eb8f01b
This commit is contained in:
1 parent
5eb1ca15f3
commit
9172bfe647
2 files changed
+19
-22
No files matched your search
@@ -44,7 +44,6 @@ inline std::string tracingCategoryToString(const Category &category)
|
||||
return "disabled-by-default-devtools.screenshot";
|
||||
default:
|
||||
folly::assume_unreachable();
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+19
-21
@@ -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(
|
||||
@@ -1169,27 +1168,26 @@ TEST_P(RuntimeSchedulerTest, errorInTaskShouldNotStopMicrotasks) {
|
||||
auto microtaskRan = false;
|
||||
auto taskRan = false;
|
||||
|
||||
auto callback = createHostFunctionFromLambda([&](bool /* unused */) {
|
||||
taskRan = true;
|
||||
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();
|
||||
});
|
||||
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);
|
||||
runtime_->queueMicrotask(microtaskCallback);
|
||||
|
||||
throw jsi::JSError(*runtime_, "Test error");
|
||||
|
||||
return jsi::Value::undefined();
|
||||
});
|
||||
throw jsi::JSError(*runtime_, "Test error");
|
||||
});
|
||||
|
||||
runtimeScheduler_->scheduleTask(
|
||||
SchedulerPriority::NormalPriority, std::move(callback));
|
||||
|
||||
Reference in new issue
Block a user