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
print"Values:" (function(data)
__bsConsequent=data.valuesif__bsConsequent<>invalidthenreturn__bsConsequentelsereturn []
endif end function)(data)
this transpilation causes a run-time error: Function Call Operator ( ) attempted on non-function. (runtime error &he0)
however, if it is preceded with a semi-colon, then it does not have any problem.
print"Values:"; data.values ?? []
gives:
print"Values:"; (function(data)
__bsConsequent=data.valuesif__bsConsequent<>invalidthenreturn__bsConsequentelsereturn []
endif end function)(data)
If any self-invoking function in transpilation (eg. null-coalescing, ternary, etc.) is in a print statement.. it's probably best to precede it with a semi-colon.
The text was updated successfully, but these errors were encountered:
Alternately, we could just ALWAYS insert a semicolon between parts of a print statement... I don't think that would hurt anything.
markwpearce
changed the title
Null-coalescing transpilation causes problems in some situations.
Null-coalescing transpilation can cause problems in print statements
May 17, 2024
Consider:
transpiles to:
this transpilation causes a run-time error:
Function Call Operator ( ) attempted on non-function. (runtime error &he0)
however, if it is preceded with a semi-colon, then it does not have any problem.
gives:
If any self-invoking function in transpilation (eg. null-coalescing, ternary, etc.) is in a print statement.. it's probably best to precede it with a semi-colon.
The text was updated successfully, but these errors were encountered: