mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-02 00:25:34 +08:00
- Compile mesh construction, transforms, cloning, and material updates for native and WASI targets. - Preserve subclass dispatch, fluent returns, and shared array identity in JavaScript packages. - Support native class arrays and recursive conversions without materializing classes for type checks.
12 lines
484 B
JavaScript
12 lines
484 B
JavaScript
const shared = [1, 2, 3];
|
|
const a = {values: shared}, b = {nested: {values: shared}};
|
|
console.log('identity', a.values === b.nested.values, a.values === shared);
|
|
a.values[1] = 8;
|
|
console.log('write', shared[1], b.nested.values[1]);
|
|
shared.push(4);
|
|
console.log('push', a.values.length, b.nested.values.join(','));
|
|
b.nested.values.pop();
|
|
console.log('pop', shared.length, a.values.join(','));
|
|
const separate = {values: [1, 8, 3]};
|
|
console.log('distinct', separate.values === a.values);
|