mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
bd89afa284
commit
dc254acace
+1
-7
@@ -200,13 +200,7 @@ TEST_P(
|
||||
return jsi::Value::undefined();
|
||||
});
|
||||
|
||||
// Hermes doesn't expose a C++ API to schedule microtasks, so we just access
|
||||
// the API that it exposes to JS.
|
||||
auto global = runtime_->global();
|
||||
auto enqueueJobFn = global.getPropertyAsObject(*runtime_, "HermesInternal")
|
||||
.getPropertyAsFunction(*runtime_, "enqueueJob");
|
||||
|
||||
enqueueJobFn.call(*runtime_, std::move(microtaskCallback));
|
||||
runtime_->queueMicrotask(microtaskCallback);
|
||||
|
||||
return jsi::Value::undefined();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user