While I was working on new tests for import() I found that JSC is not throwing early ReferenceErrors described in updateexpressions and assignmentexpressions. This commit lists some examples: https://github.com/tc39/test262/pull/1897/commits/04d40998568e093c87a887e68029d247e126806e The ReferenceError happens on runtime evaluation phase, it should happen in the parse phase. Some examples using dynamic import: ``` import('')-- import('')++ ++import('') --import('') import('') = 1 import('') *= 1 ``` I also found this bug is not only for dynamic import and it's happening with other invalid AssignmentTargetTypes: ``` throw "foo"; (() => 1) = 1 ``` The code above should throw a ReferenceError and not "foo". --- This bug might be a duplicate of Bug 177218, but I didn't have time to fully review this other report, yet.
Yeah, bug 177218 appears to be the general bug for "JSC lacks the notion of an early ReferenceError".
*** This bug has been marked as a duplicate of bug 197603 ***