| 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 |
|
| 18 |
DecimalDigits :: |
| 19 |
DecimalDigit |
| 20 |
... |
| 21 |
|
| 22 |
DecimalDigit :: one of |
| 23 |
0 1 2 3 4 5 6 7 8 9 |
| 24 |
|
| 25 |
features: [numeric-separator-literal] |
| 26 |
---*/ |
| 27 |
|
| 28 |
assert.sameValue(Number("1_0"), NaN, "1_0"); |
| 29 |
assert.sameValue(Number("1_1"), NaN, "1_1"); |
| 30 |
assert.sameValue(Number("1_2"), NaN, "1_2"); |
| 31 |
assert.sameValue(Number("1_3"), NaN, "1_3"); |
| 32 |
assert.sameValue(Number("1_4"), NaN, "1_4"); |
| 33 |
assert.sameValue(Number("1_5"), NaN, "1_5"); |
| 34 |
assert.sameValue(Number("1_6"), NaN, "1_6"); |
| 35 |
assert.sameValue(Number("1_7"), NaN, "1_7"); |
| 36 |
assert.sameValue(Number("1_8"), NaN, "1_8"); |
| 37 |
assert.sameValue(Number("1_9"), NaN, "1_9"); |