From 6a91e5c958a8cc6b451215c2a5adfeaa1cdff135 Mon Sep 17 00:00:00 2001 From: Hao19911125 <99091644+Hao19911125@users.noreply.github.com> Date: Fri, 3 Apr 2026 11:14:25 +0800 Subject: [PATCH] Fix message received microtask scheduling --- event-binding.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/event-binding.js b/event-binding.js index fa5f942..1095378 100644 --- a/event-binding.js +++ b/event-binding.js @@ -507,10 +507,10 @@ export function onMessageReceivedController( _type = "", ) { const enqueueMicrotask = - typeof runtime.queueMicrotask === "function" - ? runtime.queueMicrotask.bind(runtime) - : typeof globalThis.queueMicrotask === "function" + typeof globalThis.queueMicrotask === "function" ? globalThis.queueMicrotask.bind(globalThis) + : typeof runtime.queueMicrotask === "function" + ? (task) => Reflect.apply(runtime.queueMicrotask, globalThis, [task]) : (task) => Promise.resolve().then(task); const persistenceState = runtime.getGraphPersistenceState?.() || {}; const loadState = persistenceState.loadState || "";