mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-20 05:40:17 +08:00
* feat: support static buffer constructors and prototype methods - Preserve typed-array constructor identity and shared storage across JavaScript class APIs. - Support chained indexed assignments and mutable prototype methods with native receiver dispatch. - Compile Three.js geometry merging, instancing, and keyframe interpolation without a JavaScript engine. * fix: preserve native collection and dispatch semantics - Preserve typed-array identity in collections and JavaScript argument evaluation. - Keep symbol-backed fields and unreachable methods on their existing static paths. - Restore compiler bootstrapping and deferred class diagnostics. * fix: preserve inferred returns in native compilation - Update recorded return statements in place so native compilation preserves mixed JavaScript return values. * test: update inferred array coverage expectations - Recognize heterogeneous writes supported by shared JavaScript array storage.
14 lines
450 B
JavaScript
14 lines
450 B
JavaScript
// Inferred JavaScript array storage also admits heterogeneous writes in unused methods.
|
|
class Coordinates {
|
|
constructor() { this.value = 3; }
|
|
/** @param {number[]} values */
|
|
toArray(values = []) {
|
|
values[0] = this.value;
|
|
values[1] = "label";
|
|
return values;
|
|
}
|
|
}
|
|
const coordinates = new Coordinates();
|
|
const reader = { read(source, key) { return source[key]; } };
|
|
console.log(reader.read(coordinates, "value"), coordinates.value);
|