| 1 |
// Copyright (C) 2017 the V8 project authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
esid: prod-NumericLiteralSeparator |
| 6 |
description: NumericLiteralSeparator is not valid on string conversions for ToNumber operations |
| 7 |
info: | |
| 8 |
NonZeroDigit NumericLiteralSeparator DecimalDigits |
| 9 |
|
| 10 |
NumericLiteralSeparator :: |
| 11 |
_ |
| 12 |
|
| 13 |
DecimalIntegerLiteral :: |
| 14 |
... |
| 15 |
NonZeroDigit NumericLiteralSeparator_opt DecimalDigits |
| 16 |
|
| 17 |
NonZeroDigit :: one of |
| 18 |
1 2 3 4 5 6 7 8 9 |
| 19 |
|
| 20 |
DecimalDigits :: |
| 21 |
DecimalDigit |
| 22 |
... |
| 23 |
|
| 24 |
DecimalDigit :: one of |
| 25 |
0 1 2 3 4 5 6 7 8 9 |
| 26 |
|
| 27 |
features: [numeric-separator-literal] |
| 28 |
---*/ |
| 29 |
|
| 30 |
assert.sameValue(Number("1_0"), NaN, "1_0"); |
| 31 |
assert.sameValue(Number("1_1"), NaN, "1_1"); |
| 32 |
assert.sameValue(Number("2_2"), NaN, "2_2"); |
| 33 |
assert.sameValue(Number("3_3"), NaN, "3_3"); |
| 34 |
assert.sameValue(Number("4_4"), NaN, "4_4"); |
| 35 |
assert.sameValue(Number("5_5"), NaN, "5_5"); |
| 36 |
assert.sameValue(Number("6_6"), NaN, "6_6"); |
| 37 |
assert.sameValue(Number("7_7"), NaN, "7_7"); |
| 38 |
assert.sameValue(Number("8_8"), NaN, "8_8"); |
| 39 |
assert.sameValue(Number("9_9"), NaN, "9_9"); |