Debian Codegraph @

js/src/tests/test262/language/literals/bigint/numeric-separators/numeric-separator-literal-oil-od-nsl-od-one-of.js

raw
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: >
7 `0o` | `0O` OctalDigit NumericLiteralSeparator OctalDigit
8 info: |
9 NumericLiteral ::
10 DecimalIntegerLiteral BigIntLiteralSuffix
11 NumericLiteralBase BigIntLiteralSuffix
12
13 NumericLiteralBase ::
14 BinaryIntegerLiteral
15 OctalIntegerLiteral
16 HexIntegerLiteral
17
18 BigIntLiteralSuffix :: n
19
20 NumericLiteralSeparator ::
21 _
22
23 OctalIntegerLiteral ::
24 0o OctalDigits
25 0O OctalDigits
26
27 OctalDigits ::
28 OctalDigit
29 OctalDigits OctalDigit
30 OctalDigits NumericLiteralSeparator OctalDigit
31
32 OctalDigit :: one of
33 0 1 2 3 4 5 6 7
34
35 features: [BigInt, numeric-separator-literal]
36 ---*/
37
38 assert.sameValue(0o0_0n, 0o00n);
39 assert.sameValue(0o1_1n, 0o11n);
40 assert.sameValue(0o2_2n, 0o22n);
41 assert.sameValue(0o3_3n, 0o33n);
42 assert.sameValue(0o4_4n, 0o44n);
43 assert.sameValue(0o5_5n, 0o55n);
44 assert.sameValue(0o6_6n, 0o66n);
45 assert.sameValue(0o7_7n, 0o77n);
46
47 reportCompare(0, 0);