Files
scriptc/tests/corpus/js-class-stored-method-receiver.js
Chris Tate a07998f667 Expand static three.js workflows and host integration (#621)
* Expand static three.js workflows and host integration

* Preserve JavaScript class state in static three.js workflows

* Preserve inferred JavaScript behavior across static workflows

* Preserve inferred callables and native compatibility boundaries

* Retain annotated JavaScript factory exports and bootstrap-safe call spreads

* Preserve Buffer and child callback identities in static packages

* Clarify JavaScript symbol spread support
2026-10-02 19:56:34 -05:00

15 lines
521 B
JavaScript

class Track {
constructor(value = 2) { this.value = value; this.factory = this.create; }
size() { return this.value; }
create(multiplier = 1) { return this.size() * multiplier; }
}
const tracks = [new Track(), new Track(4)];
for (const track of tracks) console.log(track.factory(3));
console.log(tracks[1].factory());
const dynamic = JSON.parse('{}');
dynamic.track = tracks[0];
console.log(dynamic.track.factory(5));
const shared = tracks[0].factory;
tracks[1].factory = shared;
console.log(tracks[1].factory(2));