You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The abstract operation QuoteJSONString with argument _value_ wraps a String value in QUOTATION MARK code units and escapes certain other code units within it.</p>
36160
+
<p>This operation interprets a String value as a sequence of UTF-16 encoded code points, as described in <emu-xref href="#sec-ecmascript-language-types-string-type"></emu-xref>.</p>
36160
36161
<emu-alg>
36161
36162
1. Let _product_ be the String value consisting solely of the code unit 0x0022 (QUOTATION MARK).
36162
-
1. For each code unit _C_ in _value_, do
36163
-
1. If the numeric value of _C_ is listed in the Code Unit Value column of <emu-xref href="#table-json-single-character-escapes"></emu-xref>, then
36163
+
1. Let _cpList_ be a List containing in order the code points of _value_ when interpreted as a sequence of UTF-16 encoded code points as described in <emu-xref href="#sec-ecmascript-language-types-string-type"></emu-xref>.
36164
+
1. For each code point _C_ in _cpList_, do
36165
+
1. If _C_ is listed in the Code Point column of <emu-xref href="#table-json-single-character-escapes"></emu-xref>, then
36164
36166
1. Set _product_ to the string-concatenation of _product_ and the Escape Sequence for _C_ as specified in <emu-xref href="#table-json-single-character-escapes"></emu-xref>.
36165
-
1. Else if _C_ has a numeric value less than 0x0020 (SPACE), then
36166
-
1. Set _product_ to the string-concatenation of _product_ and UnicodeEscape(_C_).
36167
+
1. Else if _C_ has a numeric value less than 0x0020 (SPACE), or _C_ has the same numeric value as a <emu-xref href="#leading-surrogate"></emu-xref> or <emu-xref href="#trailing-surrogate"></emu-xref>, then
36168
+
1. Let _unit_ be a code unit whose numeric value is that of _C_.
36169
+
1. Set _product_ to the string-concatenation of _product_ and UnicodeEscape(_unit_).
36167
36170
1. Else,
36168
-
1. Set _product_ to the string-concatenation of _product_ and _C_.
36171
+
1. Set _product_ to the string-concatenation of _product_ and the <emu-xref aoid="UTF16Encoding"></emu-xref> of _C_.
36169
36172
1. Set _product_ to the string-concatenation of _product_ and the code unit 0x0022 (QUOTATION MARK).
0 commit comments