-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wasm_run_flutter on Safari browser: build() fails #56
Comments
Playing around with the cached built files I found that the issue arise in TableTy? _getTableType(Object value) {
final t = _getType(value);
if (t == null) return null;
final ty = ValueTy.values.byName(t['element']! as String); //here fails on Safari
return TableTy(
element: ty,
minimum: t['minimum']! as int,
maximum: t['maximum'] as int?,
);
} |
Fixed, "funcref" is not part of Enum ValueTy, because ValueTy has "funcRef", UPDATE: Seems the divergences between browsers are not about case sensitive, is that Chrome return null in the line before, while this doesn't happen on Safari. The code below does the trick and fix the final ty = ValueTy.values.firstWhere((value) =>
value.toString().split('.').last.toLowerCase() ==
(t['element']! as String).toLowerCase()); |
There is something else strange, Map<String, Object?>? _getType(Object value) {
print("Properties of value: ${value.jsify()}");
if (!js_util.hasProperty(value, 'type')) return null;
final type = js_util.callMethod<Object?>(value, 'type', const []);
return (js_util.dartify(type)! as Map).cast();
}
|
Thanks for the issue and the PR! |
Thanks! As soon is approved on pub.dev will try my test, I think shall be good. |
Could you publish the update of wasm_run_flutter so that it targets wasm_run 0.1.0+2 ? Thank you |
I believe |
Confirmed, works :) updated from +1 to +2 |
Trying to .build() a basic WASM module on Safari seems to return this error, while running the same on Firefox or Chrome works fine
Tried also with .buildSync()
I'm investigating, quite strange.
It might be related to (?)UPDATE:
A couple of Issues are around
_getTableType
+Enum ValueTy
and_getType
.Map<String, Object?> null
so_getTableType
execution is stopped and return aTableTy
null, while Safari throw an exception when calling_getType
but for some reason continue the execution of_getTableType
t['element'] == 'funcref'
while the enum isfuncRef
The text was updated successfully, but these errors were encountered: