numeric-separator-literal-dd-nsl-dd-one-of.js (1065B)
1 // Copyright (C) 2019 Leo Balter. 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: NonZeroDigit NumericLiteralSeparator DecimalDigit 7 info: | 8 NumericLiteral :: 9 DecimalIntegerLiteral BigIntLiteralSuffix 10 NumericLiteralBase BigIntLiteralSuffix 11 12 NumericLiteralBase :: 13 BinaryIntegerLiteral 14 OctalIntegerLiteral 15 HexIntegerLiteral 16 17 BigIntLiteralSuffix :: n 18 19 NumericLiteralSeparator :: 20 _ 21 22 DecimalIntegerLiteral :: 23 ... 24 NonZeroDigit NumericLiteralSeparator_opt DecimalDigits 25 26 27 DecimalDigits :: 28 DecimalDigit 29 ... 30 31 DecimalDigit :: one of 32 0 1 2 3 4 5 6 7 8 9 33 34 features: [BigInt, numeric-separator-literal] 35 ---*/ 36 37 assert.sameValue(1_0n, 10n); 38 assert.sameValue(1_1n, 11n); 39 assert.sameValue(1_2n, 12n); 40 assert.sameValue(1_3n, 13n); 41 assert.sameValue(1_4n, 14n); 42 assert.sameValue(1_5n, 15n); 43 assert.sameValue(1_6n, 16n); 44 assert.sameValue(1_7n, 17n); 45 assert.sameValue(1_8n, 18n); 46 assert.sameValue(1_9n, 19n); 47 48 reportCompare(0, 0);