crypto
crypto copied to clipboard
'and' statement with non-existent property should have runtime error
Summary
brs behaves correctly in the below scenario, where we would expect to see a runtime error:
foo = {}
if true and foo.bar then
print "yep"
else
print "nope"
end if
And the runtime error (working as expected):
Attempting to 'and' boolean with non-boolean value
left: Boolean
right: Invalid
Attempting to 'and' boolean with non-boolean value
left: Boolean
right: Invalid
The same does not occur if it's not an and. For example, the following incorrectly prints nope:
foo = {}
if foo.bar then
print "yep"
else
print "nope"
end if
Instead, it should match behavior in RBI, which throws a runtime error.