Parent: #496
Related: #493, #460, #461, #536, #537
Problem
Lexer.lexIdentName scans every escaped identifier once to validate Unicode escapes and IdentifierStart/IdentifierPart, then decodeIdent rescans the entire raw identifier and appends every non-escaped byte individually into arena storage. Generated code using escaped bindings/properties, obfuscator output, conformance workloads, and adversarial wide parameter lists therefore pay two full scans plus avoidable per-byte growth/copy work.
Scope
- Add parser-only 1K/2K/4K escaped-identifier growth rows with frozen source construction, decoded-name structural checks, warmup, and timed parse boundary.
- Preserve the existing allocation-free source slice for unescaped ASCII/Unicode identifiers.
- At the first escape, materialize decoded storage once, copy raw spans in batches, decode each Unicode escape during the validating scan, and remove the redundant second scan.
- Preserve escaped-keyword distinction, IdentifierStart/IdentifierPart validation, Unicode scalar bounds,
\\uXXXX/\\u{X} behavior, non-ASCII raw identifiers, diagnostics/source positions, private names, and source lifetime.
Security and correctness
- Exact decoded bytes, not hashes, determine identifier identity.
- Invalid escapes and invalid decoded start/continue characters must retain exact SyntaxError classification/location.
- Decoding must remain OOM-propagating and failure-atomic; no global cache or attacker-predictable intern table may be introduced.
- Do not special-case benchmark names, loosen Unicode validation, change escaped keyword semantics, or defer early errors.
Acceptance
Parent: #496
Related: #493, #460, #461, #536, #537
Problem
Lexer.lexIdentNamescans every escaped identifier once to validate Unicode escapes and IdentifierStart/IdentifierPart, thendecodeIdentrescans the entire raw identifier and appends every non-escaped byte individually into arena storage. Generated code using escaped bindings/properties, obfuscator output, conformance workloads, and adversarial wide parameter lists therefore pay two full scans plus avoidable per-byte growth/copy work.Scope
\\uXXXX/\\u{X}behavior, non-ASCII raw identifiers, diagnostics/source positions, private names, and source lifetime.Security and correctness
Acceptance