| 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: sec-tonumber-applied-to-the-string-type |
| 6 |
description: > |
| 7 |
The NSL does not affect strings parsed by parseFloat - NonZeroDigit NumericLiteralSeparator DecimalDigit |
| 8 |
info: | |
| 9 |
|
| 10 |
StrUnsignedDecimalLiteral ::: |
| 11 |
StrUnsignedDecimalLiteral |
| 12 |
|
| 13 |
NonZeroDigit ::: one of |
| 14 |
1 2 3 4 5 6 7 8 9 |
| 15 |
|
| 16 |
StrDecimalDigits ::: |
| 17 |
DecimalDigit |
| 18 |
... |
| 19 |
|
| 20 |
DecimalDigit ::: one of |
| 21 |
0 1 2 3 4 5 6 7 8 9 |
| 22 |
|
| 23 |
features: [numeric-separator-literal] |
| 24 |
---*/ |
| 25 |
|
| 26 |
assert.sameValue(parseFloat("1_0"), 1); |
| 27 |
assert.sameValue(parseFloat("1_1"), 1); |
| 28 |
assert.sameValue(parseFloat("2_2"), 2); |
| 29 |
assert.sameValue(parseFloat("3_3"), 3); |
| 30 |
assert.sameValue(parseFloat("4_4"), 4); |
| 31 |
assert.sameValue(parseFloat("5_5"), 5); |
| 32 |
assert.sameValue(parseFloat("6_6"), 6); |
| 33 |
assert.sameValue(parseFloat("7_7"), 7); |
| 34 |
assert.sameValue(parseFloat("8_8"), 8); |
| 35 |
assert.sameValue(parseFloat("9_9"), 9); |