$SFN.parallel, $SFN.map, and $SFN.retry (upcoming) will fail if any in scope member was never initialized.
let t;
try {
t = $SFN.map(async () => {
return func();
});
} catch {
t = [];
}
In order to make t available in parallel, we try to copy the value into the scope, but since the value doesn't exist, the state will fail.
Ideally, we should only copy in captured variables, not the entire scope.
This would just leave the edge case of a member that may or may not be initialized going into a scope that it may not be used in
let t;
if(x) {
t = [];
}
try {
t = $SFN.map(async () => {
if(x) {
return func(t);
}
return func();
});
} catch {
t = [];
}
When x is falsey, the machine will fail.
We could error when scope copying is non-deterministic.