Implement parsing, evaluation, lexical this capture, and new rejection for arrow functions. Covers expression bodies, block bodies, zero/single/ multi-param forms, and backtracking disambiguation from grouping parens. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9 lines
161 B
JavaScript
9 lines
161 B
JavaScript
// Arrow functions cannot be used as constructors
|
|
var f = () => 1;
|
|
try {
|
|
new f();
|
|
console.log("FAIL: should have thrown");
|
|
} catch (e) {
|
|
console.log(e);
|
|
}
|