Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Declare the js context as nullable in skwasm surface callback #45810

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/skwasm/skwasm_impl/surface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class SkwasmSurface {
return completer.future;
}

void _callbackHandler(JSNumber callbackId, JSNumber context, JSAny jsContext) {
void _callbackHandler(JSNumber callbackId, JSNumber context, JSAny? jsContext) {
final Completer<JSAny> completer = _pendingCallbacks.remove(callbackId.toDartInt)!;
if (jsContext.isUndefinedOrNull) {
completer.complete(context);
Expand Down
3 changes: 2 additions & 1 deletion lib/web_ui/skwasm/library_skwasm_support.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ mergeInto(LibraryManager.library, {
object.close();
}
associatedObjectsMap.delete(data.pointer);
return;
default:
console.warn('unrecognized skwasm message');
console.warn(`unrecognized skwasm message: ${skwasmMessage}`);
}
};
if (!threadId) {
Expand Down