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ยง
- Source
Text - Exact source bytes plus an equal-width UTF-8 carrier for the scalar lexer.
- Source
Text Slice - A character-boundary-aligned byte range of
SourceText. - Source
Text Utf16 Units - The original ECMAScript UTF-16 code units recovered from carrier text.
- Surrogate
Marker - One surrogate-code-unit substitution in a
SourceTextcarrier.