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

Commit 87b2bda

Browse files
Declare the js context as nullable in skwasm surface callback (#45810)
Declaring this as non-nullable causes breakage with an incoming JS interop change from the SDK. Marking this as nullable fixes the issue. This doesn't actually change any behavior. The breakages were in `test/ui/image_golden_test.dart`. No changes to the test are required (they did catch the issue when the dart roll happened).
1 parent 741d6e3 commit 87b2bda

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/web_ui/lib/src/engine/skwasm/skwasm_impl/surface.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class SkwasmSurface {
7878
return completer.future;
7979
}
8080

81-
void _callbackHandler(JSNumber callbackId, JSNumber context, JSAny jsContext) {
81+
void _callbackHandler(JSNumber callbackId, JSNumber context, JSAny? jsContext) {
8282
final Completer<JSAny> completer = _pendingCallbacks.remove(callbackId.toDartInt)!;
8383
if (jsContext.isUndefinedOrNull) {
8484
completer.complete(context);

lib/web_ui/skwasm/library_skwasm_support.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ mergeInto(LibraryManager.library, {
3939
object.close();
4040
}
4141
associatedObjectsMap.delete(data.pointer);
42+
return;
4243
default:
43-
console.warn('unrecognized skwasm message');
44+
console.warn(`unrecognized skwasm message: ${skwasmMessage}`);
4445
}
4546
};
4647
if (!threadId) {

0 commit comments

Comments
 (0)