diff --git a/spec.html b/spec.html index da3871c7cd..cb4de79dd1 100644 --- a/spec.html +++ b/spec.html @@ -16239,7 +16239,7 @@

Syntax

- +

Numeric Literals

Syntax

@@ -16251,6 +16251,7 @@

Syntax

DecimalBigIntegerLiteral NonDecimalIntegerLiteral[+Sep] NonDecimalIntegerLiteral[+Sep] BigIntLiteralSuffix + LegacyOctalIntegerLiteral DecimalBigIntegerLiteral :: `0` BigIntLiteralSuffix @@ -16274,6 +16275,7 @@

Syntax

`0` NonZeroDigit NonZeroDigit NumericLiteralSeparator? DecimalDigits[+Sep] + NonOctalDecimalIntegerLiteral DecimalDigits[Sep] :: DecimalDigit @@ -16318,9 +16320,25 @@

Syntax

OctalDigits[?Sep] OctalDigit [+Sep] OctalDigits[+Sep] NumericLiteralSeparator OctalDigit + LegacyOctalIntegerLiteral :: + `0` OctalDigit + LegacyOctalIntegerLiteral OctalDigit + + NonOctalDecimalIntegerLiteral :: + `0` NonOctalDigit + LegacyOctalLikeDecimalIntegerLiteral NonOctalDigit + NonOctalDecimalIntegerLiteral DecimalDigit + + LegacyOctalLikeDecimalIntegerLiteral :: + `0` OctalDigit + LegacyOctalLikeDecimalIntegerLiteral OctalDigit + OctalDigit :: one of `0` `1` `2` `3` `4` `5` `6` `7` + NonOctalDigit :: one of + `8` `9` + HexIntegerLiteral[Sep] :: `0x` HexDigits[?Sep] `0X` HexDigits[?Sep] @@ -16337,9 +16355,21 @@

Syntax

For example: `3in` is an error and not the two input elements `3` and `in`.

-

A conforming implementation, when processing strict mode code, must not extend, as described in , the syntax of |NumericLiteral| to include , nor extend the syntax of |DecimalIntegerLiteral| to include .

- + +

Static Semantics: Early Errors

+ + NumericLiteral :: LegacyOctalIntegerLiteral + + DecimalIntegerLiteral :: NonOctalDecimalIntegerLiteral + +
    +
  • It is a Syntax Error if the source code matching this production is strict mode code.
  • +
+ In non-strict code, this syntax is Legacy. +
+ +

Static Semantics: MV

A numeric literal stands for a value of the Number type or the BigInt type.

    @@ -16434,10 +16464,10 @@

    Static Semantics: MV

    The MV of DecimalDigit :: `7` or of NonZeroDigit :: `7` or of HexDigit :: `7` or of OctalDigit :: `7` is 7.
  • - The MV of DecimalDigit :: `8` or of NonZeroDigit :: `8` or of HexDigit :: `8` is 8. + The MV of DecimalDigit :: `8` or of NonZeroDigit :: `8` or of NonOctalDigit :: `8` or of HexDigit :: `8` is 8.
  • - The MV of DecimalDigit :: `9` or of NonZeroDigit :: `9` or of HexDigit :: `9` is 9. + The MV of DecimalDigit :: `9` or of NonZeroDigit :: `9` or of NonOctalDigit :: `9` or of HexDigit :: `9` is 9.
  • The MV of HexDigit :: `a` or of HexDigit :: `A` is 10. @@ -16487,6 +16517,27 @@

    Static Semantics: MV

  • The MV of OctalDigits :: OctalDigits NumericLiteralSeparator OctalDigit is (the MV of |OctalDigits| × 8) plus the MV of |OctalDigit|.
  • +
  • + The MV of LegacyOctalIntegerLiteral :: `0` OctalDigit is the MV of |OctalDigit|. +
  • +
  • + The MV of LegacyOctalIntegerLiteral :: LegacyOctalIntegerLiteral OctalDigit is (the MV of |LegacyOctalIntegerLiteral| times 8) plus the MV of |OctalDigit|. +
  • +
  • + The MV of NonOctalDecimalIntegerLiteral :: `0` NonOctalDigit is the MV of |NonOctalDigit|. +
  • +
  • + The MV of NonOctalDecimalIntegerLiteral :: LegacyOctalLikeDecimalIntegerLiteral NonOctalDigit is (the MV of |LegacyOctalLikeDecimalIntegerLiteral| times 10) plus the MV of |NonOctalDigit|. +
  • +
  • + The MV of NonOctalDecimalIntegerLiteral :: NonOctalDecimalIntegerLiteral DecimalDigit is (the MV of |NonOctalDecimalIntegerLiteral| times 10) plus the MV of |DecimalDigit|. +
  • +
  • + The MV of LegacyOctalLikeDecimalIntegerLiteral :: `0` OctalDigit is the MV of |OctalDigit|. +
  • +
  • + The MV of LegacyOctalLikeDecimalIntegerLiteral :: LegacyOctalLikeDecimalIntegerLiteral OctalDigit is (the MV of |LegacyOctalLikeDecimalIntegerLiteral| times 10) plus the MV of |OctalDigit|. +
  • The MV of HexIntegerLiteral :: `0x` HexDigits is the MV of |HexDigits|.
  • @@ -16515,6 +16566,10 @@

    Static Semantics: NumericValue

    1. Return 𝔽(MV of |NonDecimalIntegerLiteral|). + NumericLiteral :: LegacyOctalIntegerLiteral + + 1. Return 𝔽(MV of |LegacyOctalIntegerLiteral|). + NumericLiteral :: NonDecimalIntegerLiteral BigIntLiteralSuffix 1. Return the BigInt value that represents the MV of |NonDecimalIntegerLiteral|. @@ -27034,7 +27089,7 @@

    Forbidden Extensions

    The Syntactic Grammar must not be extended in any manner that allows the token `:` to immediately follow source text that matches the |BindingIdentifier| nonterminal symbol.
  • - When processing strict mode code, the syntax of |NumericLiteral| must not be extended to include and the syntax of |DecimalIntegerLiteral| must not be extended to include as described in . + When processing strict mode code, an implementation must not relax the early error rules of .
  • |TemplateCharacter| must not be extended to include or as defined in . @@ -44972,7 +45027,11 @@

    Lexical Grammar

    + + + + @@ -45333,78 +45392,6 @@

    Additional ECMAScript Features for Web Browsers

    Additional Syntax

    - -

    Numeric Literals

    -

    The syntax and semantics of is extended as follows except that this extension is not allowed for strict mode code:

    -

    Syntax

    - - NumericLiteral :: - DecimalLiteral - DecimalBigIntegerLiteral - NonDecimalIntegerLiteral[+Sep] - NonDecimalIntegerLiteral[+Sep] BigIntLiteralSuffix - LegacyOctalIntegerLiteral - - LegacyOctalIntegerLiteral :: - `0` OctalDigit - LegacyOctalIntegerLiteral OctalDigit - - DecimalIntegerLiteral :: - `0` - NonZeroDigit - NonZeroDigit NumericLiteralSeparator? DecimalDigits[+Sep] - NonOctalDecimalIntegerLiteral - - NonOctalDecimalIntegerLiteral :: - `0` NonOctalDigit - LegacyOctalLikeDecimalIntegerLiteral NonOctalDigit - NonOctalDecimalIntegerLiteral DecimalDigit - - LegacyOctalLikeDecimalIntegerLiteral :: - `0` OctalDigit - LegacyOctalLikeDecimalIntegerLiteral OctalDigit - - NonOctalDigit :: one of - `8` `9` - - - -

    Static Semantics

    -
      -
    • - The MV of LegacyOctalIntegerLiteral :: `0` OctalDigit is the MV of |OctalDigit|. -
    • -
    • - The MV of LegacyOctalIntegerLiteral :: LegacyOctalIntegerLiteral OctalDigit is (the MV of |LegacyOctalIntegerLiteral| times 8) plus the MV of |OctalDigit|. -
    • -
    • - The MV of DecimalIntegerLiteral :: NonOctalDecimalIntegerLiteral is the MV of |NonOctalDecimalIntegerLiteral|. -
    • -
    • - The MV of NonOctalDecimalIntegerLiteral :: `0` NonOctalDigit is the MV of |NonOctalDigit|. -
    • -
    • - The MV of NonOctalDecimalIntegerLiteral :: LegacyOctalLikeDecimalIntegerLiteral NonOctalDigit is (the MV of |LegacyOctalLikeDecimalIntegerLiteral| times 10) plus the MV of |NonOctalDigit|. -
    • -
    • - The MV of NonOctalDecimalIntegerLiteral :: NonOctalDecimalIntegerLiteral DecimalDigit is (the MV of |NonOctalDecimalIntegerLiteral| times 10) plus the MV of |DecimalDigit|. -
    • -
    • - The MV of LegacyOctalLikeDecimalIntegerLiteral :: `0` OctalDigit is the MV of |OctalDigit|. -
    • -
    • - The MV of LegacyOctalLikeDecimalIntegerLiteral :: LegacyOctalLikeDecimalIntegerLiteral OctalDigit is (the MV of |LegacyOctalLikeDecimalIntegerLiteral| times 10) plus the MV of |OctalDigit|. -
    • -
    • - The MV of NonOctalDigit :: `8` is 8. -
    • -
    • - The MV of NonOctalDigit :: `9` is 9. -
    • -
    -
    -
    -

    String Literals

    The syntax and semantics of is extended as follows except that this extension is not allowed for strict mode code:

    @@ -46549,7 +46536,7 @@

    The Strict Mode of ECMAScript

    `implements`, `interface`, `let`, `package`, `private`, `protected`, `public`, `static`, and `yield` are reserved words within strict mode code. ().
  • - A conforming implementation, when processing strict mode code, must not extend, as described in , the syntax of |NumericLiteral| to include , nor extend the syntax of |DecimalIntegerLiteral| to include . + A conforming implementation, when processing strict mode code, must disallow instances of the productions NumericLiteral :: LegacyOctalIntegerLiteral and DecimalIntegerLiteral :: NonOctalDecimalIntegerLiteral.
  • A conforming implementation, when processing strict mode code, may not extend the syntax of |EscapeSequence| to include or as described in .