Skip to content

Commit dc254ac

Browse files
rubennortefacebook-github-bot
authored andcommitted
Use new JSI method to queue microtasks in RuntimeSchedulerTest
Summary: Changelog: [internal] Now that `jsi::Runtime::queueMicrotask` is available, we can use it instead of calling an internal Hermes API in `RuntimeSchedulerTest`. Reviewed By: christophpurrer Differential Revision: D54416245 fbshipit-source-id: c9cbd3783d9dc1c3df499a7fec7acb6c229ec571
1 parent bd89afa commit dc254ac

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

packages/react-native/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,7 @@ TEST_P(
200200
return jsi::Value::undefined();
201201
});
202202

203-
// Hermes doesn't expose a C++ API to schedule microtasks, so we just access
204-
// the API that it exposes to JS.
205-
auto global = runtime_->global();
206-
auto enqueueJobFn = global.getPropertyAsObject(*runtime_, "HermesInternal")
207-
.getPropertyAsFunction(*runtime_, "enqueueJob");
208-
209-
enqueueJobFn.call(*runtime_, std::move(microtaskCallback));
203+
runtime_->queueMicrotask(microtaskCallback);
210204

211205
return jsi::Value::undefined();
212206
});

0 commit comments

Comments
 (0)