Files
scriptc/tests/corpus/js-static-method-values.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
556 B
JavaScript

class RecordValue {
constructor(value) { this.value = value; }
static read(object) { return object.value; }
static label(object) { return this.read(object) + ":" + this.tag; }
toJSON() { return this.constructor.label(this); }
}
RecordValue.tag = "base";
class Child extends RecordValue {}
Child.tag = "child";
const value = new Child("hello");
console.log(value.toJSON());
const read = Child.read;
console.log(read === RecordValue.read, read({ value: "detached" }));
console.log(Child.missing === undefined, Child.prototype.constructor === Child);