You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like .julius is compiled to invalid JS in a certain situation:
When I use an arrow function which only contains one if statement, the compiler omits the curly braces of the function body. This roduces invalid JS: Uncaught SyntaxError: expected expression, got keyword 'if'
$(function(){$('.button').click(()=>{if(!confirm('Really delete?'))returnfalse//return // without this line .julius compiles this { ... } to just <expr> which doesn't compile})})
compiled to:
…$('.button').click(()=>if(!confirm('Wollen Sie die Reservierung wirklich stornieren?'))returnfalse)…
PS: Sorry, I never used Shakespeare alone, so I don't know how to provide a minimal example.
I can't work on this issue right now, only wanted to have it documented somewhere.
The text was updated successfully, but these errors were encountered:
schoettl
changed the title
Julius arrow function with curly brace body is compiled to expression even if it's not
Julius arrow function with curly brace body is compiled to expression even if it's not an expression
Oct 17, 2022
It looks like .julius is compiled to invalid JS in a certain situation:
When I use an arrow function which only contains one
if
statement, the compiler omits the curly braces of the function body. This roduces invalid JS:Uncaught SyntaxError: expected expression, got keyword 'if'
compiled to:
PS: Sorry, I never used Shakespeare alone, so I don't know how to provide a minimal example.
I can't work on this issue right now, only wanted to have it documented somewhere.
The text was updated successfully, but these errors were encountered: