diff --git a/test/language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bd-err.js b/test/language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bd-err.js new file mode 100644 index 0000000000000000000000000000000000000000..44a9cb1ee857f33f30f6768a65eb099f9f8f84ab --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bd-err.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not be the appear adjacent to `0b` | `0B` in a + BinaryIntegerLiteral +info: | + NumericLiteralSeparator :: + _ + + BinaryIntegerLiteral :: + 0b BinaryDigits + 0B BinaryDigits + + BinaryDigits :: + BinaryDigit + BinaryDigits BinaryDigit + BinaryDigits NumericLiteralSeparator BinaryDigit + + BinaryDigit :: one of + 0 1 + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +0b_1 diff --git a/test/language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bd.js b/test/language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bd.js new file mode 100644 index 0000000000000000000000000000000000000000..f9d5d3cf02099f2009b0f24cef53aa18521f1349 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bd.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `0b` | `0B` BinaryDigit NumericLiteralSeparator BinaryDigit +info: | + NumericLiteralSeparator :: + _ + + BinaryIntegerLiteral :: + 0b BinaryDigits + 0B BinaryDigits + + BinaryDigits :: + BinaryDigit + BinaryDigits BinaryDigit + BinaryDigits NumericLiteralSeparator BinaryDigit + + BinaryDigit :: one of + 0 1 + +---*/ + +assert.sameValue(0b0_1, 0b01); +assert.sameValue(0B0_1, 0B01); diff --git a/test/language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bds.js b/test/language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bds.js new file mode 100644 index 0000000000000000000000000000000000000000..26b19114f78e913cb1ff945ed261074540f18092 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bds.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `0b` | `0B` BinaryDigit NumericLiteralSeparator BinaryDigit +info: | + NumericLiteralSeparator :: + _ + + BinaryIntegerLiteral :: + 0b BinaryDigits + 0B BinaryDigits + + BinaryDigits :: + BinaryDigit + BinaryDigits BinaryDigit + BinaryDigits NumericLiteralSeparator BinaryDigit + + BinaryDigit :: one of + 0 1 + +---*/ + +assert.sameValue(0b0_10, 0b010); +assert.sameValue(0B0_10, 0B010); diff --git a/test/language/literals/numeric/numeric-separator-literal-bil-bds-nsl-bd.js b/test/language/literals/numeric/numeric-separator-literal-bil-bds-nsl-bd.js new file mode 100644 index 0000000000000000000000000000000000000000..323259549b15035fec582030731c2c9d1bad8111 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-bil-bds-nsl-bd.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `0b` | `0B` BinaryDigits NumericLiteralSeparator BinaryDigit +info: | + NumericLiteralSeparator :: + _ + + BinaryIntegerLiteral :: + 0b BinaryDigits + 0B BinaryDigits + + BinaryDigits :: + BinaryDigit + BinaryDigits BinaryDigit + BinaryDigits NumericLiteralSeparator BinaryDigit + + BinaryDigit :: one of + 0 1 + +---*/ + +assert.sameValue(0b01_0, 0b010); +assert.sameValue(0B01_0, 0B010); diff --git a/test/language/literals/numeric/numeric-separator-literal-bil-bds-nsl-bds.js b/test/language/literals/numeric/numeric-separator-literal-bil-bds-nsl-bds.js new file mode 100644 index 0000000000000000000000000000000000000000..744913f05c61ca0ae6ce95d2ca63c1a4772e3439 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-bil-bds-nsl-bds.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `0b` | `0B` BinaryDigits NumericLiteralSeparator BinaryDigit +info: | + NumericLiteralSeparator :: + _ + + BinaryIntegerLiteral :: + 0b BinaryDigits + 0B BinaryDigits + + BinaryDigits :: + BinaryDigit + BinaryDigits BinaryDigit + BinaryDigits NumericLiteralSeparator BinaryDigit + + BinaryDigit :: one of + 0 1 + +---*/ + +assert.sameValue(0b01_00, 0b0100); +assert.sameValue(0B01_00, 0B0100); diff --git a/test/language/literals/numeric/numeric-separator-literal-bil-nsl-bd-dunder-err.js b/test/language/literals/numeric/numeric-separator-literal-bil-nsl-bd-dunder-err.js new file mode 100644 index 0000000000000000000000000000000000000000..3cadb7a8116c621a850b4259590097a5d4534b3c --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-bil-nsl-bd-dunder-err.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not appear adjacent to another + NumericLiteralSeparator in a BinaryIntegerLiteral +info: | + NumericLiteralSeparator :: + _ + + BinaryIntegerLiteral :: + 0b BinaryDigits + 0B BinaryDigits + + BinaryDigits :: + BinaryDigit + BinaryDigits BinaryDigit + BinaryDigits NumericLiteralSeparator BinaryDigit + + BinaryDigit :: one of + 0 1 + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +0b0__0 diff --git a/test/language/literals/numeric/numeric-separator-literal-bil-nsl-bd-err.js b/test/language/literals/numeric/numeric-separator-literal-bil-nsl-bd-err.js new file mode 100644 index 0000000000000000000000000000000000000000..51ac17e97a18bd681fe6bbc9398762c4389a9539 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-bil-nsl-bd-err.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not be the last digit character of a + BinaryIntegerLiteral +info: | + NumericLiteralSeparator :: + _ + + BinaryIntegerLiteral :: + 0b BinaryDigits + 0B BinaryDigits + + BinaryDigits :: + BinaryDigit + BinaryDigits BinaryDigit + BinaryDigits NumericLiteralSeparator BinaryDigit + + BinaryDigit :: one of + 0 1 + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +0b0_ diff --git a/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-minus-dd-nsl-dd.js b/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-minus-dd-nsl-dd.js new file mode 100644 index 0000000000000000000000000000000000000000..f7bca1ee7b08ef752004eda258b1e28660b597f9 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-minus-dd-nsl-dd.js @@ -0,0 +1,26 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + DecimalDigits `.` DecimalDigits ExponentPart_opt `-` DecimalDigits +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + DecimalIntegerLiteral . DecimalDigits_opt ExponentPart_opt + + DecimalDigits :: + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + + SignedInteger :: + ... + - DecimalDigits + ... + +---*/ + +assert.sameValue(1.0e-1_0, 1.0e-10); diff --git a/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-minus-dds-nsl-dd.js b/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-minus-dds-nsl-dd.js new file mode 100644 index 0000000000000000000000000000000000000000..9057143c62d57ffa01dff527aad2c95e9ec96411 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-minus-dds-nsl-dd.js @@ -0,0 +1,26 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + DecimalDigits `.` DecimalDigits ExponentPart_opt `-` DecimalDigits +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + DecimalIntegerLiteral . DecimalDigits_opt ExponentPart_opt + + DecimalDigits :: + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + + SignedInteger :: + ... + - DecimalDigits + ... + +---*/ + +assert.sameValue(1.0e-10_0, 1.0e-100); diff --git a/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-plus-dd-nsl-dd.js b/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-plus-dd-nsl-dd.js new file mode 100644 index 0000000000000000000000000000000000000000..ac5b67c2b7d3b02129fe946e07cae57ef302c328 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-plus-dd-nsl-dd.js @@ -0,0 +1,26 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + DecimalDigits `.` DecimalDigits ExponentPart_opt `+` DecimalDigits +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + DecimalIntegerLiteral . DecimalDigits_opt ExponentPart_opt + + DecimalDigits :: + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + + SignedInteger :: + ... + + DecimalDigits + ... + +---*/ + +assert.sameValue(1.0e+1_0, 1.0e+10); diff --git a/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-plus-dds-nsl-dd.js b/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-plus-dds-nsl-dd.js new file mode 100644 index 0000000000000000000000000000000000000000..eeeb5f957eb707fb296acacdef6feb6640f21071 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-plus-dds-nsl-dd.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + DecimalDigits `.` DecimalDigits ExponentPart_opt `+` DecimalDigits +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + DecimalIntegerLiteral . DecimalDigits_opt ExponentPart_opt + + DecimalDigits :: + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + + SignedInteger :: + ... + + DecimalDigits + ... + +---*/ + +assert.sameValue(1.0e+10_0, 1.0e+100); + diff --git a/test/language/literals/numeric/numeric-separator-literal-dd-nsl-dd-one-of.js b/test/language/literals/numeric/numeric-separator-literal-dd-nsl-dd-one-of.js new file mode 100644 index 0000000000000000000000000000000000000000..79f5b5ada08c17af9b1a3843bff2e512be40e939 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dd-nsl-dd-one-of.js @@ -0,0 +1,34 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: NonZeroDigit NumericLiteralSeparator DecimalDigit +info: | + NumericLiteralSeparator :: + _ + + DecimalIntegerLiteral :: + ... + NonZeroDigit NumericLiteralSeparator_opt DecimalDigits + + + DecimalDigits :: + DecimalDigit + ... + + DecimalDigit :: one of + 0 1 2 3 4 5 6 7 8 9 + +---*/ + +assert.sameValue(1_0, 10); +assert.sameValue(1_1, 11); +assert.sameValue(1_2, 12); +assert.sameValue(1_3, 13); +assert.sameValue(1_4, 14); +assert.sameValue(1_5, 15); +assert.sameValue(1_6, 16); +assert.sameValue(1_7, 17); +assert.sameValue(1_8, 18); +assert.sameValue(1_9, 19); diff --git a/test/language/literals/numeric/numeric-separator-literal-dd-nsl-dds-dunder-err.js b/test/language/literals/numeric/numeric-separator-literal-dd-nsl-dds-dunder-err.js new file mode 100644 index 0000000000000000000000000000000000000000..800714be2c097cf64db3052672b99759aa578f2f --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dd-nsl-dds-dunder-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not appear adjacent to another + NumericLiteralSeparator in a DecimalIntegerLiteral +info: | + NumericLiteralSeparator :: + _ + + DecimalIntegerLiteral :: + ... + NonZeroDigit NumericLiteralSeparator_opt DecimalDigits + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +1__0123456789 diff --git a/test/language/literals/numeric/numeric-separator-literal-dd-nsl-err.js b/test/language/literals/numeric/numeric-separator-literal-dd-nsl-err.js new file mode 100644 index 0000000000000000000000000000000000000000..11b89ce2c67b012fe1d05094b255a69d0a655ec0 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dd-nsl-err.js @@ -0,0 +1,26 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not be the last digit character +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + DecimalIntegerLiteral . DecimalDigits_opt ExponentPart_opt + + DecimalDigits :: + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +1_ diff --git a/test/language/literals/numeric/numeric-separator-literal-dds-dot-dd-nsl-dd-ep-dd.js b/test/language/literals/numeric/numeric-separator-literal-dds-dot-dd-nsl-dd-ep-dd.js new file mode 100644 index 0000000000000000000000000000000000000000..a3f78d5060e086b84ab5159125acd3678f05d640 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dds-dot-dd-nsl-dd-ep-dd.js @@ -0,0 +1,25 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + DecimalDigits `.` DecimalDigits NumericLiteralSeparator DecimalDigits + ExponentPart SignedInteger +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + . DecimalDigits ExponentPart_opt + + DecimalDigits :: + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + + ExponentIndicator :: one of + e E + +---*/ + +assert.sameValue(10.00_01e2, 10.0001e2); diff --git a/test/language/literals/numeric/numeric-separator-literal-dds-nsl-dd.js b/test/language/literals/numeric/numeric-separator-literal-dds-nsl-dd.js new file mode 100644 index 0000000000000000000000000000000000000000..3ca1dee1e3d391effcd3585be704e3b81baf2541 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dds-nsl-dd.js @@ -0,0 +1,26 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: DecimalDigits NumericLiteralSeparator DecimalDigit +info: | + NumericLiteralSeparator :: + _ + + DecimalDigits :: + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + +---*/ + +assert.sameValue(123456789_0, 1234567890); +assert.sameValue(123456789_1, 1234567891); +assert.sameValue(123456789_2, 1234567892); +assert.sameValue(123456789_3, 1234567893); +assert.sameValue(123456789_4, 1234567894); +assert.sameValue(123456789_5, 1234567895); +assert.sameValue(123456789_6, 1234567896); +assert.sameValue(123456789_7, 1234567897); +assert.sameValue(123456789_8, 1234567898); +assert.sameValue(123456789_9, 1234567899); diff --git a/test/language/literals/numeric/numeric-separator-literal-dds-nsl-dds-dunder-err.js b/test/language/literals/numeric/numeric-separator-literal-dds-nsl-dds-dunder-err.js new file mode 100644 index 0000000000000000000000000000000000000000..560fe23576b2ba4ecf3ad420100ed7e7973d2c35 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dds-nsl-dds-dunder-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not appear adjacent to another + NumericLiteralSeparator in DecimalIntegerLiteral +info: | + NumericLiteralSeparator :: + _ + + DecimalIntegerLiteral :: + ... + NonZeroDigit NumericLiteralSeparator_opt DecimalDigits + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +10__0123456789 diff --git a/test/language/literals/numeric/numeric-separator-literal-dds-nsl-err.js b/test/language/literals/numeric/numeric-separator-literal-dds-nsl-err.js new file mode 100644 index 0000000000000000000000000000000000000000..a72b521e73a9d0047b2d7bf1b8932cc441ae4ffd --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dds-nsl-err.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not be the last digit character of a + DecimalLiteral +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + DecimalIntegerLiteral . DecimalDigits_opt ExponentPart_opt + + DecimalDigits :: + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +10_ diff --git a/test/language/literals/numeric/numeric-separator-literal-dil-dot-dds-nsl-ep-dd-err.js b/test/language/literals/numeric/numeric-separator-literal-dil-dot-dds-nsl-ep-dd-err.js new file mode 100644 index 0000000000000000000000000000000000000000..ce96ca079b2d2e1ab8e6c7b9527241984b8be4dc --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dil-dot-dds-nsl-ep-dd-err.js @@ -0,0 +1,26 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not appear adjacent to ExponentPart +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + DecimalIntegerLiteral . DecimalDigits_opt ExponentPart_opt + + DecimalDigits :: + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +10.0_e1 diff --git a/test/language/literals/numeric/numeric-separator-literal-dil-dot-nsl-ep-err.js b/test/language/literals/numeric/numeric-separator-literal-dil-dot-nsl-ep-err.js new file mode 100644 index 0000000000000000000000000000000000000000..9b2c418bef459e467372b6de5d8db09c219a36ba --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dil-dot-nsl-ep-err.js @@ -0,0 +1,29 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not appear between `.` and ExponentPart +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + DecimalIntegerLiteral . DecimalDigits_opt ExponentPart_opt + + DecimalDigits :: + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + + ExponentIndicator :: one of + e E + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +10._e1 diff --git a/test/language/literals/numeric/numeric-separator-literal-dil-dot-nsl-err.js b/test/language/literals/numeric/numeric-separator-literal-dil-dot-nsl-err.js new file mode 100644 index 0000000000000000000000000000000000000000..6d7542eb79328389ff7d83ad8b5991c638d3a190 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dil-dot-nsl-err.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not be the last digit character of a + DecimalLiteral +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + DecimalIntegerLiteral . DecimalDigits_opt ExponentPart_opt + + DecimalDigits :: + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +10._ diff --git a/test/language/literals/numeric/numeric-separator-literal-dot-dd-nsl-dd-ep.js b/test/language/literals/numeric/numeric-separator-literal-dot-dd-nsl-dd-ep.js new file mode 100644 index 0000000000000000000000000000000000000000..26cf232cf99e141c58c5e485fe41f95acf054151 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dot-dd-nsl-dd-ep.js @@ -0,0 +1,25 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `.` DecimalDigit NumericLiteralSeparator DecimalDigit ExponentPart +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + . DecimalDigits ExponentPart_opt + + DecimalDigits :: + DecimalDigit + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + + ExponentIndicator :: one of + e E + +---*/ + +assert.sameValue(.0_1e2, .01e2); diff --git a/test/language/literals/numeric/numeric-separator-literal-dot-dd-nsl-dds-ep.js b/test/language/literals/numeric/numeric-separator-literal-dot-dd-nsl-dds-ep.js new file mode 100644 index 0000000000000000000000000000000000000000..0ded986ab66fdd7c9a240e93a8664414f4f23560 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dot-dd-nsl-dds-ep.js @@ -0,0 +1,25 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `.` DecimalDigit NumericLiteralSeparator DecimalDigits ExponentPart +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + . DecimalDigits ExponentPart_opt + + DecimalDigits :: + DecimalDigit + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + + ExponentIndicator :: one of + e E + +---*/ + +assert.sameValue(.1_01e2, .101e2); diff --git a/test/language/literals/numeric/numeric-separator-literal-dot-dds-nsl-dd-ep.js b/test/language/literals/numeric/numeric-separator-literal-dot-dds-nsl-dd-ep.js new file mode 100644 index 0000000000000000000000000000000000000000..e3acbad8a23e2e9e63a8aff074b6655601f88245 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dot-dds-nsl-dd-ep.js @@ -0,0 +1,25 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `.` DecimalDigits NumericLiteralSeparator DecimalDigit ExponentPart +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + . DecimalDigits ExponentPart_opt + + DecimalDigits :: + DecimalDigit + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + + ExponentIndicator :: one of + e E + +---*/ + +assert.sameValue(.10_1e2, .101e2); diff --git a/test/language/literals/numeric/numeric-separator-literal-dot-dds-nsl-dds-ep.js b/test/language/literals/numeric/numeric-separator-literal-dot-dds-nsl-dds-ep.js new file mode 100644 index 0000000000000000000000000000000000000000..c437ef997c65e65b1e000fda2871a0115d991f3c --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dot-dds-nsl-dds-ep.js @@ -0,0 +1,25 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `.` DecimalDigits NumericLiteralSeparator DecimalDigits ExponentPart +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + . DecimalDigits ExponentPart_opt + + DecimalDigits :: + DecimalDigit + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + + ExponentIndicator :: one of + e E + +---*/ + +assert.sameValue(.00_01e2, .0001e2); diff --git a/test/language/literals/numeric/numeric-separator-literal-dot-dds-nsl-ep-err.js b/test/language/literals/numeric/numeric-separator-literal-dot-dds-nsl-ep-err.js new file mode 100644 index 0000000000000000000000000000000000000000..f968e63d6c1635b0d9b70bb846c8fd72417b39a6 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dot-dds-nsl-ep-err.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: NumericLiteralSeparator may not appear adjacent to ExponentPart +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + . DecimalDigits ExponentPart_opt + + DecimalDigits :: + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + + ExponentIndicator :: one of + e E + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +.0_e1 diff --git a/test/language/literals/numeric/numeric-separator-literal-dot-nsl-ep-err.js b/test/language/literals/numeric/numeric-separator-literal-dot-nsl-ep-err.js new file mode 100644 index 0000000000000000000000000000000000000000..df26f129d56cdd58c56cd58148f35826ef6d3142 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dot-nsl-ep-err.js @@ -0,0 +1,29 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not appear between `.` and ExponentPart +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + . DecimalDigits ExponentPart_opt + + DecimalDigits :: + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + + ExponentIndicator :: one of + e E + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +._e1 diff --git a/test/language/literals/numeric/numeric-separator-literal-dot-nsl-err.js b/test/language/literals/numeric/numeric-separator-literal-dot-nsl-err.js new file mode 100644 index 0000000000000000000000000000000000000000..322dcbf8ee62079cd4b514fb36d92aa55761b623 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-dot-nsl-err.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not be the last digit character of a + DecimalLiteral, nor adjacent to `.` +info: | + NumericLiteralSeparator :: + _ + + DecimalLiteral :: + . DecimalDigits ExponentPart_opt + + DecimalDigits :: + ... + DecimalDigits NumericLiteralSeparator DecimalDigit + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +._ diff --git a/test/language/literals/numeric/numeric-separator-literal-hil-hd-nsl-hd-err.js b/test/language/literals/numeric/numeric-separator-literal-hil-hd-nsl-hd-err.js new file mode 100644 index 0000000000000000000000000000000000000000..d4f73eed20f78215a98d2527122040f9aa7f78e2 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-hil-hd-nsl-hd-err.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not be the appear adjacent to `0x` | `0X` in a + HexIntegerLiteral +info: | + NumericLiteralSeparator :: + _ + + HexIntegerLiteral :: + 0x HexDigits + 0X HexDigits + + HexDigits :: + HexDigit + HexDigits HexDigit + HexDigits NumericLiteralSeparator HexDigit + + HexDigit::one of + 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +0x_1 diff --git a/test/language/literals/numeric/numeric-separator-literal-hil-hd-nsl-hd.js b/test/language/literals/numeric/numeric-separator-literal-hil-hd-nsl-hd.js new file mode 100644 index 0000000000000000000000000000000000000000..f8a33c65f45e93ff7396fd66a9ff671213e24e05 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-hil-hd-nsl-hd.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `0x` | `0X` HexDigit NumericLiteralSeparator HexDigit +info: | + NumericLiteralSeparator :: + _ + + HexIntegerLiteral :: + 0x HexDigits + 0X HexDigits + + HexDigits :: + HexDigit + HexDigits HexDigit + HexDigits NumericLiteralSeparator HexDigit + + HexDigit::one of + 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F + +---*/ + +assert.sameValue(0x0_1, 0x01); +assert.sameValue(0X0_1, 0X01); diff --git a/test/language/literals/numeric/numeric-separator-literal-hil-hd-nsl-hds.js b/test/language/literals/numeric/numeric-separator-literal-hil-hd-nsl-hds.js new file mode 100644 index 0000000000000000000000000000000000000000..0561c9ad95dbbafda73f4a4eac9e88db74b15b03 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-hil-hd-nsl-hds.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `0x` | `0X` HexDigit NumericLiteralSeparator HexDigit +info: | + NumericLiteralSeparator :: + _ + + HexIntegerLiteral :: + 0x HexDigits + 0X HexDigits + + HexDigits :: + HexDigit + HexDigits HexDigit + HexDigits NumericLiteralSeparator HexDigit + + HexDigit::one of + 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F + +---*/ + +assert.sameValue(0x0_10, 0x010); +assert.sameValue(0X0_10, 0X010); diff --git a/test/language/literals/numeric/numeric-separator-literal-hil-hds-nsl-hd.js b/test/language/literals/numeric/numeric-separator-literal-hil-hds-nsl-hd.js new file mode 100644 index 0000000000000000000000000000000000000000..6dff72fa38b762873522f017947dd8494c795c4a --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-hil-hds-nsl-hd.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `0x` | `0X` HexDigits NumericLiteralSeparator HexDigit +info: | + NumericLiteralSeparator :: + _ + + HexIntegerLiteral :: + 0x HexDigits + 0X HexDigits + + HexDigits :: + HexDigit + HexDigits HexDigit + HexDigits NumericLiteralSeparator HexDigit + + HexDigit::one of + 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F + +---*/ + +assert.sameValue(0x01_0, 0x010); +assert.sameValue(0X01_0, 0X010); diff --git a/test/language/literals/numeric/numeric-separator-literal-hil-hds-nsl-hds.js b/test/language/literals/numeric/numeric-separator-literal-hil-hds-nsl-hds.js new file mode 100644 index 0000000000000000000000000000000000000000..2672484cbca266b21d875f742ef0ba87aad4c68e --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-hil-hds-nsl-hds.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `0x` | `0X` HexDigits NumericLiteralSeparator HexDigit +info: | + NumericLiteralSeparator :: + _ + + HexIntegerLiteral :: + 0x HexDigits + 0X HexDigits + + HexDigits :: + HexDigit + HexDigits HexDigit + HexDigits NumericLiteralSeparator HexDigit + + HexDigit::one of + 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F + +---*/ + +assert.sameValue(0x01_00, 0x0100); +assert.sameValue(0X01_00, 0X0100); diff --git a/test/language/literals/numeric/numeric-separator-literal-hil-nsl-hd-dunder-err.js b/test/language/literals/numeric/numeric-separator-literal-hil-nsl-hd-dunder-err.js new file mode 100644 index 0000000000000000000000000000000000000000..dcf0f40a37d131f9fa24af284e3b8703da3e45e0 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-hil-nsl-hd-dunder-err.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not appear adjacent to another + NumericLiteralSeparator in a HexIntegerLiteral +info: | + NumericLiteralSeparator :: + _ + + HexIntegerLiteral :: + 0x HexDigits + 0X HexDigits + + HexDigits :: + HexDigit + HexDigits HexDigit + HexDigits NumericLiteralSeparator HexDigit + + HexDigit::one of + 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +0x0__0 diff --git a/test/language/literals/numeric/numeric-separator-literal-hil-nsl-hd-err.js b/test/language/literals/numeric/numeric-separator-literal-hil-nsl-hd-err.js new file mode 100644 index 0000000000000000000000000000000000000000..7205cbb2198989b501acc235f128ef2881ce2728 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-hil-nsl-hd-err.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not be the last digit character of a + HexIntegerLiteral +info: | + NumericLiteralSeparator :: + _ + + HexIntegerLiteral :: + 0x HexDigits + 0X HexDigits + + HexDigits :: + HexDigit + HexDigits HexDigit + HexDigits NumericLiteralSeparator HexDigit + + HexDigit::one of + 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +0x0_ diff --git a/test/language/literals/numeric/numeric-separator-literal-hil-od-nsl-od-one-of.js b/test/language/literals/numeric/numeric-separator-literal-hil-od-nsl-od-one-of.js new file mode 100644 index 0000000000000000000000000000000000000000..3f81986dd5d99f4dcbac4169f2d63679fbd46aee --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-hil-od-nsl-od-one-of.js @@ -0,0 +1,47 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `0x` | `0X` HexDigit NumericLiteralSeparator HexDigit +info: | + NumericLiteralSeparator :: + _ + + HexIntegerLiteral :: + 0x HexDigits + 0X HexDigits + + HexDigits :: + HexDigit + HexDigits HexDigit + HexDigits NumericLiteralSeparator HexDigit + + HexDigit::one of + 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F + +---*/ + +assert.sameValue(0x0_0, 0x00); +assert.sameValue(0x1_1, 0x11); +assert.sameValue(0x2_2, 0x22); +assert.sameValue(0x3_3, 0x33); +assert.sameValue(0x4_4, 0x44); +assert.sameValue(0x5_5, 0x55); +assert.sameValue(0x6_6, 0x66); +assert.sameValue(0x7_7, 0x77); +assert.sameValue(0x8_8, 0x88); +assert.sameValue(0x9_9, 0x99); +assert.sameValue(0xa_a, 0xaa); +assert.sameValue(0xb_b, 0xbb); +assert.sameValue(0xc_c, 0xcc); +assert.sameValue(0xd_d, 0xdd); +assert.sameValue(0xe_e, 0xee); +assert.sameValue(0xf_f, 0xff); +assert.sameValue(0xA_A, 0xAA); +assert.sameValue(0xB_B, 0xBB); +assert.sameValue(0xC_C, 0xCC); +assert.sameValue(0xD_D, 0xDD); +assert.sameValue(0xE_E, 0xEE); +assert.sameValue(0xF_F, 0xFF); diff --git a/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dd-one-of.js b/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dd-one-of.js new file mode 100644 index 0000000000000000000000000000000000000000..528546e4b1c0705e0a47ac2ee26386687f68b46f --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dd-one-of.js @@ -0,0 +1,38 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: NonZeroDigit NumericLiteralSeparator DecimalDigit +info: | + NumericLiteralSeparator :: + _ + + DecimalIntegerLiteral :: + ... + NonZeroDigit NumericLiteralSeparator_opt DecimalDigits + + NonZeroDigit :: one of + 1 2 3 4 5 6 7 8 9 + + DecimalDigits :: + DecimalDigit + ... + + DecimalDigit :: one of + 0 1 2 3 4 5 6 7 8 9 + +---*/ + +assert.sameValue(1_0, 10); +assert.sameValue(1_1, 11); +assert.sameValue(2_2, 22); +assert.sameValue(3_3, 33); +assert.sameValue(4_4, 44); +assert.sameValue(5_5, 55); +assert.sameValue(6_6, 66); +assert.sameValue(7_7, 77); +assert.sameValue(8_8, 88); +assert.sameValue(9_9, 99); + + diff --git a/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dd.js b/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dd.js new file mode 100644 index 0000000000000000000000000000000000000000..3f6e166a838edee8407fa9eaca9132de1e458f9c --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dd.js @@ -0,0 +1,25 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: NonZeroDigit NumericLiteralSeparator DecimalDigit +info: | + NumericLiteralSeparator :: + _ + + DecimalIntegerLiteral :: + ... + NonZeroDigit NumericLiteralSeparator_opt DecimalDigits + + NonZeroDigit :: one of + 1 2 3 4 5 6 7 8 9 + + DecimalDigits :: + ... + DecimalDigits DecimalDigit + ... + +---*/ + +assert.sameValue(1_1, 11); diff --git a/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dds-dunder-err.js b/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dds-dunder-err.js new file mode 100644 index 0000000000000000000000000000000000000000..dd2f133fa084a9889db9d80ca78f966da2769f1e --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dds-dunder-err.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not appear adjacent to another + NumericLiteralSeparator in DecimalIntegerLiteral +info: | + NumericLiteralSeparator :: + _ + + DecimalIntegerLiteral :: + ... + NonZeroDigit NumericLiteralSeparator_opt DecimalDigits + + NonZeroDigit :: one of + 1 2 3 4 5 6 7 8 9 + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +0__0123456789 diff --git a/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dds-leading-zero-err.js b/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dds-leading-zero-err.js new file mode 100644 index 0000000000000000000000000000000000000000..201ac0acdf082e688b90f8ae76f82af8cfecbe2e --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dds-leading-zero-err.js @@ -0,0 +1,25 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: NonZeroDigit NumericLiteralSeparator DecimalDigits +info: | + NumericLiteralSeparator :: + _ + + DecimalIntegerLiteral :: + ... + NonZeroDigit NumericLiteralSeparator DecimalDigits + + NonZeroDigit :: one of + 1 2 3 4 5 6 7 8 9 + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +0_0123456789 diff --git a/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dds.js b/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dds.js new file mode 100644 index 0000000000000000000000000000000000000000..47ea301dace17a4346378360b533ebd361059a7d --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dds.js @@ -0,0 +1,25 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: NonZeroDigit NumericLiteralSeparator DecimalDigits +info: | + NumericLiteralSeparator :: + _ + + DecimalIntegerLiteral :: + ... + NonZeroDigit NumericLiteralSeparator_opt DecimalDigits + + NonZeroDigit :: one of + 1 2 3 4 5 6 7 8 9 + + DecimalDigits :: + ... + DecimalDigits DecimalDigit + ... + +---*/ + +assert.sameValue(1_0123456789, 10123456789); diff --git a/test/language/literals/numeric/numeric-separator-literal-oil-nsl-od-dunder-err.js b/test/language/literals/numeric/numeric-separator-literal-oil-nsl-od-dunder-err.js new file mode 100644 index 0000000000000000000000000000000000000000..9be6a2b73fc12bf15c2e14d90efe414d5dfa3418 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-oil-nsl-od-dunder-err.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not appear adjacent to another + NumericLiteralSeparator in a OctalIntegerLiteral +info: | + NumericLiteralSeparator :: + _ + + OctalIntegerLiteral :: + 0o OctalDigits + 0O OctalDigits + + OctalDigits :: + OctalDigit + OctalDigits OctalDigit + OctalDigits NumericLiteralSeparator OctalDigit + + OctalDigit :: one of + 0 1 2 3 4 5 6 7 + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +0o0__0 diff --git a/test/language/literals/numeric/numeric-separator-literal-oil-nsl-od-err.js b/test/language/literals/numeric/numeric-separator-literal-oil-nsl-od-err.js new file mode 100644 index 0000000000000000000000000000000000000000..1d8b21e8399be5b351880d379e284c18e6b011af --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-oil-nsl-od-err.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not be the last digit character of an + OctalIntegerLiteral +info: | + NumericLiteralSeparator :: + _ + + OctalIntegerLiteral :: + 0o OctalDigits + 0O OctalDigits + + OctalDigits :: + OctalDigit + OctalDigits OctalDigit + OctalDigits NumericLiteralSeparator OctalDigit + + OctalDigit :: one of + 0 1 2 3 4 5 6 7 + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +0o0_ diff --git a/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-od-err.js b/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-od-err.js new file mode 100644 index 0000000000000000000000000000000000000000..34276984f853640c616a3b18fb25552c17746d27 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-od-err.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NumericLiteralSeparator may not be the appear adjacent to `0o` | `0O` in a + OctalIntegerLiteral +info: | + NumericLiteralSeparator :: + _ + + OctalIntegerLiteral :: + 0o OctalDigits + 0O OctalDigits + + OctalDigits :: + OctalDigit + OctalDigits OctalDigit + OctalDigits NumericLiteralSeparator OctalDigit + + OctalDigit :: one of + 0 1 2 3 4 5 6 7 + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +0o_1 diff --git a/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-od-one-of.js b/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-od-one-of.js new file mode 100644 index 0000000000000000000000000000000000000000..f9d0f6b16f416a14c9d0d1f529e79cbea36f5bb1 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-od-one-of.js @@ -0,0 +1,33 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `0o` | `0O` OctalDigit NumericLiteralSeparator OctalDigit +info: | + NumericLiteralSeparator :: + _ + + OctalIntegerLiteral :: + 0o OctalDigits + 0O OctalDigits + + OctalDigits :: + OctalDigit + OctalDigits OctalDigit + OctalDigits NumericLiteralSeparator OctalDigit + + OctalDigit :: one of + 0 1 2 3 4 5 6 7 + +---*/ + +assert.sameValue(0o0_0, 0o00); +assert.sameValue(0o1_1, 0o11); +assert.sameValue(0o2_2, 0o22); +assert.sameValue(0o3_3, 0o33); +assert.sameValue(0o4_4, 0o44); +assert.sameValue(0o5_5, 0o55); +assert.sameValue(0o6_6, 0o66); +assert.sameValue(0o7_7, 0o77); diff --git a/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-od.js b/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-od.js new file mode 100644 index 0000000000000000000000000000000000000000..8555afc406e1e9fce27aef8cb36ccda44a3f532f --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-od.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `0o` | `0O` OctalDigit NumericLiteralSeparator OctalDigit +info: | + NumericLiteralSeparator :: + _ + + OctalIntegerLiteral :: + 0o OctalDigits + 0O OctalDigits + + OctalDigits :: + OctalDigit + OctalDigits OctalDigit + OctalDigits NumericLiteralSeparator OctalDigit + + OctalDigit :: one of + 0 1 2 3 4 5 6 7 + +---*/ + +assert.sameValue(0o0_1, 0o01); +assert.sameValue(0O0_1, 0O01); diff --git a/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-ods.js b/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-ods.js new file mode 100644 index 0000000000000000000000000000000000000000..70bc8396dabe0c81d3ebcfd62f48a31539cc2398 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-ods.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `0o` | `0O` OctalDigit NumericLiteralSeparator OctalDigit +info: | + NumericLiteralSeparator :: + _ + + OctalIntegerLiteral :: + 0o OctalDigits + 0O OctalDigits + + OctalDigits :: + OctalDigit + OctalDigits OctalDigit + OctalDigits NumericLiteralSeparator OctalDigit + + OctalDigit :: one of + 0 1 2 3 4 5 6 7 + +---*/ + +assert.sameValue(0o0_10, 0o010); +assert.sameValue(0O0_10, 0O010); diff --git a/test/language/literals/numeric/numeric-separator-literal-oil-ods-nsl-od.js b/test/language/literals/numeric/numeric-separator-literal-oil-ods-nsl-od.js new file mode 100644 index 0000000000000000000000000000000000000000..7083418e11e4e4182b4716d7fd6532fed228993f --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-oil-ods-nsl-od.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `0o` | `0O` OctalDigits NumericLiteralSeparator OctalDigit +info: | + NumericLiteralSeparator :: + _ + + OctalIntegerLiteral :: + 0o OctalDigits + 0O OctalDigits + + OctalDigits :: + OctalDigit + OctalDigits OctalDigit + OctalDigits NumericLiteralSeparator OctalDigit + + OctalDigit :: one of + 0 1 2 3 4 5 6 7 + +---*/ + +assert.sameValue(0o01_0, 0o010); +assert.sameValue(0O01_0, 0O010); diff --git a/test/language/literals/numeric/numeric-separator-literal-oil-ods-nsl-ods.js b/test/language/literals/numeric/numeric-separator-literal-oil-ods-nsl-ods.js new file mode 100644 index 0000000000000000000000000000000000000000..2e33e076f77c28899025d582258630f6b515855b --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-oil-ods-nsl-ods.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + `0o` | `0O` OctalDigits NumericLiteralSeparator OctalDigit +info: | + NumericLiteralSeparator :: + _ + + OctalIntegerLiteral :: + 0o OctalDigits + 0O OctalDigits + + OctalDigits :: + OctalDigit + OctalDigits OctalDigit + OctalDigits NumericLiteralSeparator OctalDigit + + OctalDigit :: one of + 0 1 2 3 4 5 6 7 + +---*/ + +assert.sameValue(0o01_00, 0o0100); +assert.sameValue(0O01_00, 0O0100); diff --git a/test/language/literals/numeric/numeric-separator-literal-sign-minus-dds-nsl-dd.js b/test/language/literals/numeric/numeric-separator-literal-sign-minus-dds-nsl-dd.js new file mode 100644 index 0000000000000000000000000000000000000000..e11952a61f15ccb82d533e88d46f1b60ad720701 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-sign-minus-dds-nsl-dd.js @@ -0,0 +1,26 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: DecimalDigits NumericLiteralSeparator DecimalDigit +info: | + NumericLiteralSeparator :: + _ + + SignedInteger :: + ... + - DecimalDigits + +---*/ + +assert.sameValue(-123456789_0, -1234567890); +assert.sameValue(-123456789_1, -1234567891); +assert.sameValue(-123456789_2, -1234567892); +assert.sameValue(-123456789_3, -1234567893); +assert.sameValue(-123456789_4, -1234567894); +assert.sameValue(-123456789_5, -1234567895); +assert.sameValue(-123456789_6, -1234567896); +assert.sameValue(-123456789_7, -1234567897); +assert.sameValue(-123456789_8, -1234567898); +assert.sameValue(-123456789_9, -1234567899); diff --git a/test/language/literals/numeric/numeric-separator-literal-sign-plus-dds-nsl-dd.js b/test/language/literals/numeric/numeric-separator-literal-sign-plus-dds-nsl-dd.js new file mode 100644 index 0000000000000000000000000000000000000000..89050f1a45c2a3ba2d20eb5f460715f3029e5b95 --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-sign-plus-dds-nsl-dd.js @@ -0,0 +1,27 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: DecimalDigits NumericLiteralSeparator DecimalDigit +info: | + NumericLiteralSeparator :: + _ + + SignedInteger :: + ... + + DecimalDigits + ... + +---*/ + +assert.sameValue(+123456789_0, 1234567890); +assert.sameValue(+123456789_1, 1234567891); +assert.sameValue(+123456789_2, 1234567892); +assert.sameValue(+123456789_3, 1234567893); +assert.sameValue(+123456789_4, 1234567894); +assert.sameValue(+123456789_5, 1234567895); +assert.sameValue(+123456789_6, 1234567896); +assert.sameValue(+123456789_7, 1234567897); +assert.sameValue(+123456789_8, 1234567898); +assert.sameValue(+123456789_9, 1234567899); diff --git a/test/language/literals/numeric/numeric-separator-literal-unicode-err.js b/test/language/literals/numeric/numeric-separator-literal-unicode-err.js new file mode 100644 index 0000000000000000000000000000000000000000..4674392f36aa081822fdd1039bdb563fa7d36c7e --- /dev/null +++ b/test/language/literals/numeric/numeric-separator-literal-unicode-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-NumericLiteralSeparator +description: > + NonZeroDigit NumericLiteralSeparator DecimalDigits sequence expressed with + unicode escape sequence +info: | + NumericLiteralSeparator:: + _ + + DecimalIntegerLiteral:: + ... + NonZeroDigit NumericLiteralSeparator_opt DecimalDigits + +negative: + phase: early + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +1\u005F0123456789