@@ -3,28 +3,28 @@ if (typeof exports !== "undefined") {
33 var testFail = require ( "./driver.js" ) . testFail ;
44}
55
6- const newBigIntLiteral = ( start , stringValue ) => ( {
6+ const newBigIntLiteral = ( start , stringValue , bigint = stringValue ) => ( {
77 start : start ,
88 type : "Literal" ,
99 end : start + stringValue . length + 1 ,
1010 value : typeof BigInt !== "undefined" ? BigInt ( stringValue ) : null ,
1111 raw : `${ stringValue } n` ,
12- bigint : stringValue
12+ bigint
1313} )
1414
1515const digits = [
1616 { d : "0" , ast : start => newBigIntLiteral ( start , "0" ) } ,
1717 { 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" ) } ,
2121 { d : "-0xbf2ed51ff75d380fd3be813ec6185780" , ast : start => ( {
2222 start : start ,
2323 type : "UnaryExpression" ,
2424 end : start + 36 ,
2525 operator : "-" ,
2626 prefix : true ,
27- argument : newBigIntLiteral ( start + 1 , "0xbf2ed51ff75d380fd3be813ec6185780" )
27+ argument : newBigIntLiteral ( start + 1 , "0xbf2ed51ff75d380fd3be813ec6185780" , "254125715536285641815112686497309415296" )
2828 } ) } ,
2929 { d : "02" , error : start => `Identifier directly after number (1:${ start + 2 } )` } ,
3030 { d : "2e2" , error : start => `Identifier directly after number (1:${ start + 3 } )` } ,
0 commit comments