4 ms·
> I guess the concern is that you could have linear code that calls a function, which does an "await" and you would effectively have a control flow detour that'
by bandrami 7y ago
> I guess the concern is that you could have linear code that calls a function, which does an "await" and you would effectively have a control flow detour that's hidden from view?
That's the main issue. The overall control flow cannot be known until the entire abstract syntax tree is generated.
- bzbarsky 7y agoTo be fair, that's a problem with GOTO as well (which JS doesn't have, yes); you don't have to go all the way to COMEFROM to get that.... That said, with JS you can't know the overall control flow even one you have the AST, because that `foo()` function call could go anywhere depending on what people did to the global scope independently of your AST. Come to think of it, you can't even determine control flow from the AST in C, unless everything involved has static linkage...