-
Notifications
You must be signed in to change notification settings - Fork 302
Closed
Labels
Description
发现 Dart 现在支持传入一个 Dart_Handler 作为 FFI 函数的参数,这意味着任何一个 Dart 对象、函数都可以直接传递到 C,然后通过 dart_api.h 里面提供的符号进行一些调用操作,包括直接获取属性,转成函数等。
看样子是可以在中间去掉 Map 有关的映射来让 C++ 对象和 Dart 对象直接对接。
dart-lang/sdk#36858
dart-lang/sdk#35770
https://github.com/google/webcrypto.dart/blob/6dd34605b16097f2845742e04cce1aa4854b07d8/src/webcrypto_dart_dl.c#L49-L72