Files
scriptc/tests/corpus/js-array-default-buffer.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

17 lines
563 B
JavaScript

class Vector {
/** @param {number[]} [target] @param {number} [offset] */
write(target = [], offset = 0) {
target[offset] = 1;
target[offset + 1] = 2;
target[offset + 2] = 3;
return target;
}
}
const vector = new Vector();
const typed = new Float64Array(4);
console.log(vector.write(typed, 1) === typed, typed.join(','));
const ordinary = [9];
console.log(vector.write(ordinary) === ordinary, ordinary.join(','), vector.write().join(','));
const detached = vector.write;
console.log(detached.call(vector, typed) === typed, typed.join(','));