Files
scriptc/tests/corpus/js-inferred-object-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

20 lines
767 B
JavaScript

class Dimensions {
/** @param {number} width @param {number} height */
constructor(width, height, depth = 1) {
const image = { width: width, height, depth };
this.image = image;
}
}
const omitted = new Dimensions();
const supplied = new Dimensions(2, 3, 4);
console.log(omitted.image.width, omitted.image.height, omitted.image.depth);
console.log(supplied.image.width, supplied.image.height, supplied.image.depth);
console.log(Object.keys(omitted.image).join(','));
supplied.image.width = undefined;
console.log(supplied.image.width, supplied.image.height);
class Nested {
/** @param {number} value */
constructor(value) { this.data = { nested: { value: (value) } }; }
}
console.log(new Nested().data.nested.value, new Nested(5).data.nested.value);