Open marzipankaiser opened 2 months ago
Would it solve the problem to turn the space after return into a nonbreaking one?
Edit: Ahh, I see, it's the whitespace of the extern...
Here is a proposal:
in the JS pretty printer strip whitespace and check that they only have one line or error otherwise.
This way we can see, whether we ever use them and react then.
When the user defines a JS extern with control effects like so:
Then the call fails at runtime with an error like:
Expected behaviour
This should return 2.
Why does this happen
The above definition gets translated to the following JS:
Semicolon insertion will insert a
;
after the return, so this is equivalent to something like:Full example code