Skip to content

Commit

Permalink
add no-op queueMicrotask for rn 0.74.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Kudo committed Jul 6, 2024
1 parent ff81260 commit b7d8453
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/v8runtime/V8Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,12 @@ jsi::Value V8Runtime::evaluatePreparedJavaScript(
return evaluateJavaScript(sourceJs, sourceJs->sourceURL());
}

#if REACT_NATIVE_MINOR_VERSION >= 75 || (REACT_NATIVE_MINOR_VERSION >= 74 && REACT_NATIVE_PATCH_VERSION >= 3)
void V8Runtime::queueMicrotask(const jsi::Function &callback) {
// TODO: add this when we revisit new architecture support
}
#endif // REACT_NATIVE_MINOR_VERSION >= 75 || (REACT_NATIVE_MINOR_VERSION >= 74 && REACT_NATIVE_PATCH_VERSION >= 3

bool V8Runtime::drainMicrotasks(int maxMicrotasksHint) {
v8::Locker locker(isolate_);
v8::Isolate::Scope scopedIsolate(isolate_);
Expand Down
3 changes: 3 additions & 0 deletions src/v8runtime/V8Runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ class V8Runtime : public facebook::jsi::Runtime {
const std::shared_ptr<const facebook::jsi::PreparedJavaScript> &js)
override;

#if REACT_NATIVE_MINOR_VERSION >= 75 || (REACT_NATIVE_MINOR_VERSION >= 74 && REACT_NATIVE_PATCH_VERSION >= 3)
void queueMicrotask(const facebook::jsi::Function &callback) override;
#endif // REACT_NATIVE_MINOR_VERSION >= 75 || (REACT_NATIVE_MINOR_VERSION >= 74 && REACT_NATIVE_PATCH_VERSION >= 3
bool drainMicrotasks(int maxMicrotasksHint = -1) override;

facebook::jsi::Object global() override;
Expand Down

0 comments on commit b7d8453

Please sign in to comment.