Skip to main content

Module wtf8

Module wtf8 

Source
Expand description

The string type JavaScript actually has, in WTF-8.

This lives below the parser rather than with the rest of the value types because the lexer has to build one: a string literal may contain a lone surrogate ("\uD800"), and Rust’s String cannot hold that, so the cooked value of a literal is a Wtf8. The runtime re-exports this type, so Value::String holds the same type the parser produced — one representation all the way through, with no conversion step at which a surrogate could be lost.

The crate is the bottom of the engine, so this module has no dependencies.

Structs§

Wtf8
A JavaScript string’s bytes, in WTF-8.