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