Expand description
Text operations with the exact semantics of JavaScript’s built-ins.
What:
Text operations with the exact semantics of the JavaScript built-ins the incumbent
applies to strings it shares with the native wrapper.
Why:
Durable strings such as process birth identities are produced by .trim() in the
incumbent;
the native wrapper must produce byte-identical strings,
and Rust’s
str::trim uses a different whitespace set (it trims U+0085 and keeps U+FEFF).
In TS you’d write (pseudocode):
text.trim()Functions§
- is_
javascript_ whitespace - What:
Whether a character is whitespace or a line terminator to ECMAScript
trim.charis one Unicode scalar value. Why: ECMA-262TrimStringremovesWhiteSpace(tab, vertical tab, form feed, space, no-break space, U+FEFF and everyZscharacter) andLineTerminator(LF, CR, U+2028, U+2029); nothing else. - trim_
javascript - What:
Remove leading and trailing JavaScript whitespace,
as
String.prototype.trim.&strborrows text; the result borrows a slice of it. Why: Shared strings must be trimmed exactly as the incumbent trims them. - trim_
javascript_ end - What:
Remove trailing JavaScript whitespace,
as
String.prototype.trimEnd.&strborrows text; the result borrows a slice of it. Why: Git’s PID file text is trimmed at the end only before itspidprefix is read.