Serialize a string as a source-safe JavaScript literal.
JSON.stringify handles the quoting; this additionally neutralises what it leaves intact but
that can terminate a script context or a string literal, so an unusual file name can never
break out of the generated source.
Serialize a string as a source-safe JavaScript literal.
JSON.stringifyhandles the quoting; this additionally neutralises what it leaves intact but that can terminate a script context or a string literal, so an unusual file name can never break out of the generated source.