mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-24 06:14:01 +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
18 lines
735 B
JavaScript
18 lines
735 B
JavaScript
const events = [];
|
|
class Entry { constructor() { this.value = 7; } }
|
|
const registry = { item: Entry };
|
|
registry.item = Entry;
|
|
console.log(registry.item === Entry, new registry.item().value);
|
|
const data = { get Entry() { events.push("getter"); return Entry; } };
|
|
const unused = { Entry: data.Entry };
|
|
class Target {}
|
|
Object.defineProperty(Target.prototype, "selected", {
|
|
set(value) { events.push("setter:" + value.name); },
|
|
});
|
|
Target.prototype.selected = Entry;
|
|
const noPrototype = { __proto__: null, Entry };
|
|
console.log(Object.getPrototypeOf(noPrototype) === null, new noPrototype.Entry().value);
|
|
const frozen = Object.freeze({ Entry });
|
|
console.log(Object.isFrozen(frozen), frozen.Entry === Entry);
|
|
console.log(events.join(","));
|