Files
rust_browser/tests/external/js262/fixtures/arrow-function-new-error.js
Zachary D. Rowitsch 75bc30bb8e Add JavaScript arrow function (=>) support
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>
2026-02-21 22:12:47 -05:00

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);
}