Skip to content

refactor(js): fix JSDomException checks for wasm compatibility#306

Open
kevmoo wants to merge 3 commits into
google:masterfrom
kevmoo:fix_wasm
Open

refactor(js): fix JSDomException checks for wasm compatibility#306
kevmoo wants to merge 3 commits into
google:masterfrom
kevmoo:fix_wasm

Conversation

@kevmoo

@kevmoo kevmoo commented Jul 4, 2026

Copy link
Copy Markdown

Resolve invalid_runtime_check_with_js_interop_types warnings for JSDomException.

Instead of directly catching the extension type JSDomException or checking e is JSObject, we catch generic objects, cast them to JSAny?, and check if they are JSDomException instances using isA<subtle.JSDomException>().

This avoids platform-inconsistent runtime checks that behave incorrectly under dart2wasm where extension types are runtime-erased.

kevmoo added 3 commits July 3, 2026 17:21
Resolve invalid_runtime_check_with_js_interop_types warnings for JSDomException.

Instead of directly catching the extension type JSDomException or checking e is JSObject, we catch generic objects, cast them to JSAny?, and check if they are JSDomException instances using isA<subtle.JSDomException>().

This avoids platform-inconsistent runtime checks that behave incorrectly under dart2wasm where extension types are runtime-erased.
Resolve _TypeError when casting generic exceptions to JSAny? under dart2wasm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant