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
When using if without brackets, the scope stays the same and variables can be shadowed:
varexpr=' var a = "test"; if (true) var a = 42; return a;';
varparser=newhscript.Parser();
varast=parser.parseString(expr);
varinterp=newhscript.Interp();
trace(interp.execute(ast)); // 42
Works as expected when using brackets.
The text was updated successfully, but these errors were encountered:
When using
if
without brackets, the scope stays the same and variables can be shadowed:Works as expected when using brackets.
The text was updated successfully, but these errors were encountered: