Skip to main content

Module text

Module text 

Source
Expand description

Byte-exact carrier text for dynamically supplied ECMAScript source.

QuickJS parses an explicitly sized byte buffer. Rust str cannot represent its accepted surrogate encodings or malformed bytes, so SourceText keeps the exact input beside an equal-width scalar carrier for the existing lexer. Surrogate code units use marked three-byte private-use scalars; malformed bytes use marked one-byte DEL scalars. Side tables distinguish those substitutions from genuine source PUA and DEL characters.

Structsยง

SourceText
Exact source bytes plus an equal-width UTF-8 carrier for the scalar lexer.
SourceTextSlice
A character-boundary-aligned byte range of SourceText.
SourceTextUtf16Units
The original ECMAScript UTF-16 code units recovered from carrier text.
SurrogateMarker
One surrogate-code-unit substitution in a SourceText carrier.