mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +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
17 lines
809 B
JavaScript
17 lines
809 B
JavaScript
function normalized(value) { return value.normalize(); }
|
|
function explicit(value) { return value.normalize(undefined); }
|
|
function decomposed(value) { return value.normalize("NFD"); }
|
|
const object = { normalize(...args) { return `${this === object}:${args.length}:${args[0]}`; } };
|
|
console.log(normalized(object), explicit(object), decomposed(object));
|
|
class Vector {
|
|
normalize(...args) { return `${this instanceof Vector}:${args.length}:${args[0]}`; }
|
|
}
|
|
const vector = new Vector();
|
|
console.log(normalized(vector), explicit(vector), decomposed(vector));
|
|
console.log(normalized("e\u0301"), explicit("e\u0301"), decomposed("é"));
|
|
class Holder {
|
|
constructor(value) { this.value = value; }
|
|
}
|
|
const held = new Holder(vector);
|
|
console.log(normalized(held.value), explicit(held.value), decomposed(held.value));
|