@@ -3,28 +3,28 @@ if (typeof exports !== "undefined") {
3
3
var testFail = require ( "./driver.js" ) . testFail ;
4
4
}
5
5
6
- const newBigIntLiteral = ( start , stringValue ) => ( {
6
+ const newBigIntLiteral = ( start , stringValue , bigint = stringValue ) => ( {
7
7
start : start ,
8
8
type : "Literal" ,
9
9
end : start + stringValue . length + 1 ,
10
10
value : typeof BigInt !== "undefined" ? BigInt ( stringValue ) : null ,
11
11
raw : `${ stringValue } n` ,
12
- bigint : stringValue
12
+ bigint
13
13
} )
14
14
15
15
const digits = [
16
16
{ d : "0" , ast : start => newBigIntLiteral ( start , "0" ) } ,
17
17
{ d : "2" , ast : start => newBigIntLiteral ( start , "2" ) } ,
18
- { d : "0x2" , ast : start => newBigIntLiteral ( start , "0x2" ) } ,
19
- { d : "0o2" , ast : start => newBigIntLiteral ( start , "0o2" ) } ,
20
- { d : "0b10" , ast : start => newBigIntLiteral ( start , "0b10" ) } ,
18
+ { d : "0x2" , ast : start => newBigIntLiteral ( start , "0x2" , "2" ) } ,
19
+ { d : "0o2" , ast : start => newBigIntLiteral ( start , "0o2" , "2" ) } ,
20
+ { d : "0b10" , ast : start => newBigIntLiteral ( start , "0b10" , "2" ) } ,
21
21
{ d : "-0xbf2ed51ff75d380fd3be813ec6185780" , ast : start => ( {
22
22
start : start ,
23
23
type : "UnaryExpression" ,
24
24
end : start + 36 ,
25
25
operator : "-" ,
26
26
prefix : true ,
27
- argument : newBigIntLiteral ( start + 1 , "0xbf2ed51ff75d380fd3be813ec6185780" )
27
+ argument : newBigIntLiteral ( start + 1 , "0xbf2ed51ff75d380fd3be813ec6185780" , "254125715536285641815112686497309415296" )
28
28
} ) } ,
29
29
{ d : "02" , error : start => `Identifier directly after number (1:${ start + 2 } )` } ,
30
30
{ d : "2e2" , error : start => `Identifier directly after number (1:${ start + 3 } )` } ,
0 commit comments