tonumber-numeric-separator-literal-nzd-nsl-dd-one-of.js (1000B)
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 StrUnsignedDecimalLiteral ::: 10 StrUnsignedDecimalLiteral 11 12 NonZeroDigit ::: one of 13 1 2 3 4 5 6 7 8 9 14 15 StrDecimalDigits ::: 16 DecimalDigit 17 ... 18 19 DecimalDigit ::: one of 20 0 1 2 3 4 5 6 7 8 9 21 22 features: [numeric-separator-literal] 23 ---*/ 24 25 assert.sameValue(parseFloat("1_0"), 1); 26 assert.sameValue(parseFloat("1_1"), 1); 27 assert.sameValue(parseFloat("2_2"), 2); 28 assert.sameValue(parseFloat("3_3"), 3); 29 assert.sameValue(parseFloat("4_4"), 4); 30 assert.sameValue(parseFloat("5_5"), 5); 31 assert.sameValue(parseFloat("6_6"), 6); 32 assert.sameValue(parseFloat("7_7"), 7); 33 assert.sameValue(parseFloat("8_8"), 8); 34 assert.sameValue(parseFloat("9_9"), 9); 35 36 reportCompare(0, 0);