diff --git a/spec.html b/spec.html index c61653bf38..cb67acb432 100644 --- a/spec.html +++ b/spec.html @@ -4793,7 +4793,7 @@

String - See grammar and conversion algorithm below. + Return ! StringToNumber(_argument_). @@ -4830,10 +4830,7 @@

ToNumber Applied to the String Type

-

ToNumber applied to Strings applies the following grammar to the input String interpreted as a sequence of UTF-16 encoded code points (). If the grammar cannot interpret the String as an expansion of |StringNumericLiteral|, then the result of ToNumber is *NaN*.

- -

The terminal symbols of this grammar are all composed of characters in the Unicode Basic Multilingual Plane (BMP). Therefore, the result of ToNumber will be *NaN* if the string contains any or code units, whether paired or unpaired.

-
+

The abstract operation StringToNumber specifies how to convert a String value to a Number value, using the following grammar.

Syntax

StringNumericLiteral ::: @@ -4887,9 +4884,27 @@

Syntax

+ +

+ StringToNumber ( + _str_: a String, + ) +

+
+
description
+
It returns a Number.
+
+ + 1. Let _text_ be ! StringToCodePoints(_str_). + 1. Let _literal_ be ParseText(_text_, |StringNumericLiteral|). + 1. If _literal_ is a List of errors, return *NaN*. + 1. Return StringNumericValue of _literal_. + +
+

Runtime Semantics: StringNumericValue

-

The conversion of a String to a Number value is similar overall to the determination of the Number value for a numeric literal (see ), but some of the details are different, so the process for converting a String numeric literal to a value of the Number type is given here.

+

The conversion of a |StringNumericLiteral| to a Number value is similar overall to the determination of the NumericValue of a |NumericLiteral| (see ), but some of the details are different.

StringNumericLiteral ::: StrWhiteSpace? 1. Return *+0*𝔽.