Skip to main content

js_escape

Function js_escape 

Source
pub(crate) fn js_escape(
    _it: &mut Interp,
    _t: Value,
    a: &[Value],
) -> Result<Value, Value>
Expand description

escape(str)(Annex B.2.1.1。ES6 で非推奨だが encodeURI 系登場以前からの 遺産として実務コードになお残る)が丸ごと未対応だった。仕様は UTF-16 コード単位ベースだが、この処理系の文字列は UTF-8(Rust String)のため Unicode スカラー値(char)単位で近似する(BMP 外文字のサロゲートペア 分割は考慮しない、他の Unicode 境界処理と同水準の簡略化)。