Files
rust_browser/tests/external/js262/fixtures/this-constructor-method.js
Zachary D. Rowitsch 0675a0be22 Add JavaScript this keyword support for constructors and method calls
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>
2026-02-21 12:54:47 -05:00

9 lines
184 B
JavaScript

function Counter() {
this.count = 0;
this.increment = function() { this.count = this.count + 1; };
}
var c = new Counter();
c.increment();
c.increment();
console.log(c.count);