Module: encoding.js

Source: ./encoding/js.reef


Overview

encoding/js — JavaScript string escaping.

Escapes code units for embedding in a JS string literal: , ', ", newline, CR, tab, NUL, and the UTF-8 sequences E2 80 A8 / E2 80 A9 (U+2028 / U+2029) as \u2028 / \u2029. Reef char is a byte; the walk is byte-wise and compares those three-byte sequences as chars (via n as char).

Usage: import encoding.js as js let safe = js.js_escape_string("a"b\n")


Functions

fn int_to_char(n: int): char

fn js_escape_string(s: string): string


Generated by reefc doc