An Issue with the && and || Operators
marccarigiet opened this issue · 3 comments
Escargot:
- OS: [Ubuntu 20.04]
- Revision [4f8582e]
Describe the bug
Some invalid Expressions involving && and || in combination with postfix operators do not throw an Error in Escargot
Test case
Test code to reproduce the behavior:
! this && ++ ! var1;
Backtrace
False
Expected behavior
I would expect an error to be thrown, as that is what the other JavaScript engines do that I ran this example on, which includes V8 and SpiderMonkey.
Further, the following expressions do throw an error:
! this && ++ this;
Script parsing error: SyntaxError: Line 1: Invalid left-hand side in assignment
this && ++ ! this;
Uncaught ReferenceError: Invalid left-hand side in assignment:
Additional test cases that trigger the same behaviour
+ this && -- delete this ;
- this && { } -- ;
delete this || -- typeof this ;
this || ! ++ ~ this ;
void this && -- void this ;
~ this || { } ++ ;
@marccarigiet Thank you for reporting the issue. I will fix it as soon as possible.
BTW can you tell me where you obtained these test codes?
These codes seems useful in identifying undetected bugs within the Escargot engine :)
@clover2123
Thanks for fixing :). The test codes were generated as part of my Bachelor's thesis, It would certainly be possible to provide you with either a set of test cases or the corresponding test case generator. I'll talk to my supervisor about it.
@marccarigiet Thank you! I'm looking forward to your positive response!