Message from JavaScript discussions

December 2018

— If the error happens concurrently, should the callback spawn as a new coroutine?


function tester() {
return 123;
const thenable = spawn tester();
thenable.then(value => doSomething).catch(error => doSomething);

— There is also a temporal dead zone here I'd have to address

— Yes

— ?

— 1. spawn runs, queues coroutine ahead of current one
2. new coroutine runs, returns value
3. first coroutine sets thenable to get the value

Message permanent page

— .then(
value => doSomething,
error => doSomething)

— So the return value is returned before there is a then set

— In the case of a direct return like that one, I mean

— Uhhh, I don't get it

— Show breaking usage

— It's just an architecture thing to address