Mario Zechner 934e374724 [flutter] Add web_ffi fork, fix .wasm/.js size
The fork is required as Emscripten produces a .wasm file that the upstream web_ffi can't parse correctly to extract exported symbols.
2022-11-20 22:18:39 +01:00

19 lines
678 B
Dart
Executable File

/// Occures if it's not possible to convert dart types to JavaScript types.
///
/// This usually happens if a not allowed type is uses as a [NativeType]'s
/// type argument, or a not allowed return value of a [NativeFunction] is
/// used.
class MarshallingException implements Exception {
final dynamic message;
const MarshallingException([this.message]);
MarshallingException.noAddress(Object o)
: this('Expected a address (int) but found ${o.runtimeType}');
MarshallingException.typeMissmatch(Type t, Object o)
: this('Expected a type of $t but object has type ${o.runtimeType}');
@override
String toString() => new Exception(message).toString();
}