Open xxshady opened 1 year ago
See reproduction code.
const handler = (key) => { alt.log("keydown", key) listenKeydown() } const listenKeydown = () => { const [listener] = alt.getEventListeners("keydown") alt.log("keydown listener:", listener) if (listener) { alt.log("alt.off keydown with invalid function ref") alt.off("keydown", () => {}) } else { alt.log("alt.on keydown") alt.on("keydown", handler) } } listenKeydown()
Maybe we should check if passed function reference is not valid and throw error?
No response
Windows 11
13.0-rc2
shared
The PR didn't actually fix it, so I will leave it open for now until we actually fix it
Description of the problem
See reproduction code.
Reproduction steps
Expected behaviour
Maybe we should check if passed function reference is not valid and throw error?
Additional context
No response
Operating system
Windows 11
Version
13.0-rc2
Scope
shared
Reproduction tested