mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-23 06:10:02 +08:00
* 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
13 lines
522 B
JavaScript
13 lines
522 B
JavaScript
const key = Symbol.for("x");
|
|
class Base { [key] = true; name = "base"; }
|
|
class C extends Base {}
|
|
const value = new C();
|
|
const plain = { ...value };
|
|
let name = "extra";
|
|
const computed = { [name]: 1, ...value };
|
|
console.log(plain.name, plain[key], Object.hasOwn(plain, key));
|
|
console.log(computed.extra, computed.name, computed[key], Object.hasOwn(computed, key));
|
|
console.log(Object.getOwnPropertySymbols(plain).length, Object.keys(plain).join(","));
|
|
plain[key] = false;
|
|
console.log(value[key], plain[key], computed[key]);
|