mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Declare the js context as nullable in skwasm surface callback (flutter/engine#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).
This commit is contained in:
parent
6211b68cff
commit
67ce410bd6
@ -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);
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user