pvdz / tenko

An 100% spec compliant ES2021 JavaScript parser written in JS

Home Page:https://pvdz.github.io/tenko/repl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lhs check for `let` left of `in` and `instanceof` is only checking `in`

pvdz opened this issue · comments

Silly oversight. Also need to write a test for it.

if ($tp_next_type === $ID_in || $tp_next_type === $ID_in) {
      return THROW_RANGE('Cannot use `let` as a regular var name as the lhs of `in` or `instanceof` in a toplevel expression statement', tok_getStart(), tok_getStop()); // And why would you.
    }