espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.73k stars 741 forks source link

An issue with void, delete and typeof and the detection of Errors #2430

Open marccarigiet opened 7 months ago

marccarigiet commented 7 months ago

OS: [Ubuntu 20.04]

Describe the bug In some cases, Errors are not detected after the void and delete Keywords.

A selection of the affected cases:

void var1;
void async;
void as;
void from; 
void yield;
void from >>= this;
void var1 += this;
delete var1 && var1;
typeof async ?? new. let; 

Expected behavior I'd expect these to throw Errors, mostly Reference Errors.

Additional context

These cases were found using comparative testing with other JavaScript Engines including V8, Spidermonkey and JavaScriptCore. To all my knowledge, this could be intended behavior on your side, but I thought I'd let you know in case it isn't.