debug(lua): покажем что мы доходим до drain и какие ошибки ловим
Сейчас связь Touched → handler рвётся где-то. Хочу видеть: 1. Срабатывает ли drain цикл (queue.length > 0) 2. Что именно catch съедает
This commit is contained in:
parent
eddf0b5a23
commit
d5b70ac4aa
@ -1855,6 +1855,8 @@ export function registerRobloxShim(lua, opts) {
|
|||||||
// Запускаем каждый в своей coroutine — wait() внутри безопасен.
|
// Запускаем каждый в своей coroutine — wait() внутри безопасен.
|
||||||
if (_pendingHandlerQueue.length > 0) {
|
if (_pendingHandlerQueue.length > 0) {
|
||||||
const queue = _pendingHandlerQueue.splice(0, _pendingHandlerQueue.length);
|
const queue = _pendingHandlerQueue.splice(0, _pendingHandlerQueue.length);
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.warn(`[handler-drain] draining ${queue.length} handlers`);
|
||||||
for (const h of queue) {
|
for (const h of queue) {
|
||||||
try {
|
try {
|
||||||
const a = h.args || [];
|
const a = h.args || [];
|
||||||
@ -1872,8 +1874,8 @@ export function registerRobloxShim(lua, opts) {
|
|||||||
result.catch(() => {});
|
result.catch(() => {});
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Тихо — handler-error это норма (yield-across-C-boundary,
|
// eslint-disable-next-line no-console
|
||||||
// wasmoon promise-detection и т.п.)
|
console.warn('[handler-drain-catch]', e?.message || e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user