Implements the `this` keyword across parser and interpreter, enabling the Test262Error constructor pattern (`this.message = msg`) needed for Tier 1 Test262 roadmap milestone. Adds token/AST support, global `this` binding, method-call receiver threading, and ES5-compliant `new` dispatch that tries JS function constructors before falling back to host constructors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5 lines
112 B
JavaScript
5 lines
112 B
JavaScript
function Point(x, y) { this.x = x; this.y = y; }
|
|
var p = new Point(10, 20);
|
|
console.log(p.x);
|
|
console.log(p.y);
|