mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-02 08:35:07 +08:00
- T[K] resolves against record bindings, Object.hasOwn/assign lower over records and the DOM, fixed shapes take runtime-keyed writes with the miss trap, and string|RegExp unions narrow by instanceof - the width family gains the checked NARROW lift and the tuple-arm literal route (the option-table shapes) - island literals complete: get accessors, plain spreads, tagged templates with .raw, jsval ??, and call-time fence deferral for unlowerable members (lambda poisons defer too) - JS variadic rests under --dynamic bind the engine arguments array and re-invoke through apply; dyn values marshal into the island as the deep copy - corpus 2470-2476 pin every landing against the Node oracle on both backends
11 lines
375 B
TypeScript
11 lines
375 B
TypeScript
// Map values of RegExp: the per-EOL pattern table — the array-element
|
|
// regex story, map form.
|
|
const regexps = new Map<string, RegExp>();
|
|
regexps.set("lf", /\n/);
|
|
regexps.set("cr", /\r/);
|
|
const lf = regexps.get("lf");
|
|
console.log(lf !== undefined && lf.test("a\nb"), regexps.size);
|
|
regexps.delete("cr");
|
|
console.log(regexps.has("cr"), regexps.size);
|
|
console.log("done");
|