3 ms·
Calculator example breaks when attempting to divide by zero: Uncaught abort(20) at Error at jsStackTrace (https://webassembly.z19.web.core.windows.
by dvt 8y ago
Calculator example breaks when attempting to divide by zero:
Uncaught abort(20) at Error
at jsStackTrace (https://webassembly.z19.web.core.windows.net/Calculator/mono.js:1063:12)
at stackTrace (https://webassembly.z19.web.core.windows.net/Calculator/mono.js:1077:11)
at abort (https://webassembly.z19.web.core.windows.net/Calculator/mono.js:18097:43)
at nullFunc_ii (https://webassembly.z19.web.core.windows.net/Calculator/mono.js:14694:2)
at b20 (wasm-function[10723]:31)
at emterpret (wasm-function[922]:12351)
at _do_icall (wasm-function[8343]:63)
at emterpret (wasm-function[922]:7917)
at _interp_exec_method_full (wasm-function[7977]:65)
at emterpret (wasm-function[922]:7129)
Which is weird, because in the actual code[1], there's a division by zero check which should pop up a message box:
case '/':
if (opr2 != 0)
{
result = (opr1 / opr2).ToString();
}
else
{
MessageBox.Show("Can't divide by zero");
}
break;
Given a closer look, I doubt this is a WasmWinforms bug, but rather mono-wasm (or somewhere else along the compilation pipeline).
Edit: I'm wrong, it's a WasmWinforms bug.
[1] https://code.msdn.microsoft.com/windowsdesktop/Simple-Calculator-54ec8e4a https://code.msdn.microsoft.com/windowsdesktop/Simple-Calcul...
- hokkos 8y agoMaybe the problem is the MessageBox method.
- dvt 8y agoGiven an even closer look, you're right ;) I saw MessageBox here[1] and assumed the implementation would just go through. After all, why would all other components compile fine, except for MessageBox? But actually, it even logs in the console dl_mapping_symbol MessageBox - proc name MessageBox not matched So yep, MessageBox has no matched symbols so it crashes and burns. [1] https://github.com/roozbehid/WasmWinforms/blob/master/winforms/external/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MessageBox.cs https://github.com/roozbehid/WasmWinforms/blob/master/winfor...