flatty
flatty copied to clipboard
Fixes to javascript emissions
-
Fixes syntax errors by adding a "let" declaration to j loop variables.
-
Suppresses "unreachable code after return" warnings by adding no-op "if (true)" conditions.
Why is this needed? Why does unreachable code after return get triggered?
The "let" syntax error fix is of course critical.
But the extra if(true):s are just a minor improvement, to keep the firefox debugger to not show any warnings: when the emitted code is inlined to other javascript code and the unconditional return gets inserted in the middle of other code, the rest of the code can never be reached, and this triggers a warning.