WASM Shell and non-standard file extensions

It seems setTimeout() itself is run during new of the promise. Its not impacted
by while (true) {} . Warning the below makes your browser unusable:

new Promise((resolve)=>console.log(setTimeout(resolve,1000))); while (true) {} 
--> 2

After that you need to kill the browser with fire. Go into task manager,
und task kill of the Chrome task group will make it usable again.

I would support any sort of fail-fast approach. In apps except the shell there might be nobody to see error messages so throwing exceptions would at least have a change to get caught and reported by services like sentry.io (when used on the page).

If the call originates from Prolog, it would be nice to get a Prolog exception which can be caught in Prolog and processed there. If the call originates from JavaScript, it would be nice to get a JavaScript Error instance which contains some Prolog exception information. Currently the Query interface sets the error property on the return value which is more suitable for shell but maybe not for non-shell apps.

Prolog await on rejected promise should throw a Prolog exception. This matches JavaScript await behavior of throwing a JavaScript exception.

1 Like

Sorry, I meant the setTimeout callback argument.