diff --git a/infra.bs b/infra.bs index 22dd39f..5c47a5b 100644 --- a/infra.bs +++ b/infra.bs @@ -26,6 +26,7 @@ Boilerplate: omit conformance, omit feedback-header, omit idl-index
 urlPrefix: https://tc39.github.io/ecma262/; spec: ECMA-262; type: dfn
     text: List; url: sec-list-and-record-specification-type
+    text: The String Type; url: sec-ecmascript-language-types-string-type
 
@@ -216,8 +217,11 @@ in parentheses. [[!UNICODE]]

In certain contexts code points are prefixed with "0x" instead of "U+". -

A scalar value is a code point that is not in the range -U+D800 to U+DFFF, inclusive. +

A surrogate code point is a code point that is in the range U+D800 to +U+DFFF, inclusive. + +

A scalar value is a code point that is not a +surrogate code point.

An ASCII code point is a code point in the range U+0000 to U+007F, inclusive. @@ -258,11 +262,31 @@ inclusive.

Strings

-

A string is a sequence of code points. Strings are denoted by double -quotes and monospace font. +

A JavaScript string is a sequence of unsigned 16-bit integers, also known as +code units. A JavaScript string can also be interpreted as +containing code points, per the conversion defined in The String Type section of the +JavaScript specification. [[!ECMA-262]] + +

A scalar value string is a sequence of scalar values. These +scalar values can also be addressed as code points. + +

A scalar value string is useful for any kind of I/O or other kind of operation +where UTF-8 encode comes into play. + + +

String can be used to refer to either a JavaScript string or +scalar value string, when it is clear from the context which is meant or when the distinction +is immaterial. Strings are denoted by double quotes and monospace font.

"Hello, world!" is a string. +

To cast a JavaScript string into a +scalar value string, replace any surrogate code points with U+FFFD. + + +

Casting a scalar value string into a JavaScript string +happens implicitly as desired as it is a lossless operation. +

An ASCII string is a string whose code points are all ASCII code points.