mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make toJS'd function use JS types (flutter/engine#44469)
JSFunction's should only accept and return JS types. Allows landing of external restrictions here: https://dart-review.googlesource.com/c/sdk/+/316867/9
This commit is contained in:
parent
0c708f040f
commit
b76eb03600
@ -21,7 +21,8 @@ import 'package:ui/src/engine.dart';
|
||||
/// 5. The finalizer function is called with the SkPaint as the sole argument.
|
||||
/// 6. We call `delete` on SkPaint.
|
||||
DomFinalizationRegistry _finalizationRegistry = createDomFinalizationRegistry(
|
||||
(UniqueRef<Object> uniq) {
|
||||
(JSBoxedDartObject boxedUniq) {
|
||||
final UniqueRef<Object> uniq = boxedUniq.toDart as UniqueRef<Object>;
|
||||
uniq.collect();
|
||||
}.toJS
|
||||
);
|
||||
@ -33,7 +34,7 @@ NativeMemoryFinalizationRegistry nativeMemoryFinalizationRegistry = NativeMemory
|
||||
class NativeMemoryFinalizationRegistry {
|
||||
void register(Object owner, UniqueRef<Object> ref) {
|
||||
if (browserSupportsFinalizationRegistry) {
|
||||
_finalizationRegistry.register(owner, ref);
|
||||
_finalizationRegistry.register(owner, ref.toJSBox);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user