Files
scriptc/tests/corpus/2476-map-regex-values.ts
Chris Tate f72a69e4b9 The formatter-runtime chain: eleven coded stops fixed at the compiler
- 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
2026-07-23 15:32:37 -05:00

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");