Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix[Runtime.evaluate]: registered RuntimeExecutor should go through R…
…untimeScheduler (facebook#47119) Summary: Pull Request resolved: facebook#47119 # Changelog: [General] [Fixed] - Microtasks are now correctly executed after the code evaluation in Console panel of DevTools. Fixes facebook#46966. `runtimeExecutor` which is propagated here, is actually being used by Hermes: https://www.internalfb.com/code/fbsource/[cba75f2b515a]/xplat/js/react-native-github/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp?lines=112-113 The issue was that any expression that should be evaluated as part of `Runtime.evaluate` was not going through `RuntimeScheduler`, because specified `runtimeExecutor` was not going through it as well, and it was defined prior to `RuntimeScheduler`. Because of this, `RuntimeScheduler` was not draining out the microtasks queue and basically any scheduled Microtasks were not executed, see T200616136. With this fix, we create an executor that goes through `RuntimeScheduler`, which is using another executor that makes sure that all scheduled callbacks are only executed after `Inspector` was setup. It is extremely messy and in the future we should untangle these circular dependencies and try to simplify the approach. Reviewed By: rubennorte Differential Revision: D64552372 fbshipit-source-id: 467d37c71a2eb7c940297ce90ca8d68268b1ff33
- Loading branch information