Make queueMicrotask pure virtual (#43311)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43311

X-link: https://github.com/facebook/hermes/pull/1337

Changelog: [internal]

We've done this in a separate diff because the changes in Hermes don't propagate immediately to the React Native repository. We need to land the changes in JSI and Hermes first (in a backwards-compatible way) and then land this in a separate commit to make the method mandatory.

Reviewed By: neildhar

Differential Revision: D54413830

fbshipit-source-id: 3b89fe0e6697b0019544b73daa89d932db97b63a
This commit is contained in:
Rubén Norte
2024-03-05 04:10:44 -08:00
committed by Facebook GitHub Bot
parent f3ce7cd76e
commit 244fe286a0
2 changed files with 1 additions and 5 deletions
@@ -87,10 +87,6 @@ NativeState::~NativeState() {}
Runtime::~Runtime() {}
void Runtime::queueMicrotask(const jsi::Function& /*callback*/) {
throw JSINativeException("queueMicrotask is not implemented in this runtime");
}
Instrumentation& Runtime::instrumentation() {
class NoInstrumentation : public Instrumentation {
std::string getRecordedGCStats() override {
@@ -214,7 +214,7 @@ class JSI_EXPORT Runtime {
/// its event loop implementation.
///
/// \param callback a function to be executed as a microtask.
virtual void queueMicrotask(const jsi::Function& callback);
virtual void queueMicrotask(const jsi::Function& callback) = 0;
/// Drain the JavaScript VM internal Microtask (a.k.a. Job in ECMA262) queue.
///