Skip to content

Conversation

@olliNiinivaara
Copy link

  • 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.

…oop variables.

- Suppresses "unreachable code after return" warnings by adding no-op "if (true)" conditions.
@olliNiinivaara olliNiinivaara changed the title - Fixes to javascript emissions Fixes to javascript emissions Jan 20, 2025
@treeform
Copy link
Owner

Why is this needed? Why does unreachable code after return get triggered?

@olliNiinivaara
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants