File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -33689,9 +33689,10 @@ namespace ts {
33689
33689
}
33690
33690
33691
33691
function checkNumericLiteralValueSize(node: NumericLiteral) {
33692
+ // Scientific notation (e.g. 2e54 and 1e00000000010) can't be converted to bigint
33692
33693
// Literals with 15 or fewer characters aren't long enough to reach past 2^53 - 1
33693
33694
// Fractional numbers (e.g. 9000000000000000.001) are inherently imprecise anyway
33694
- if (node.text.length <= 15 || node.text.indexOf(".") !== -1) {
33695
+ if (node.numericLiteralFlags & TokenFlags.Scientific || node. text.length <= 15 || node.text.indexOf(".") !== -1) {
33695
33696
return;
33696
33697
}
33697
33698
Original file line number Diff line number Diff line change 18
18
////2e52;
19
19
////2e53;
20
20
////2e54;
21
+ ////1e00000000010;
21
22
22
23
verify . codeFix ( {
23
24
description : ts . Diagnostics . Convert_to_a_bigint_numeric_literal . message ,
@@ -41,7 +42,8 @@ verify.codeFix({
41
42
-0x20000000000001;
42
43
2e52;
43
44
2e53;
44
- 2e54;`
45
+ 2e54;
46
+ 1e00000000010;`
45
47
} ) ;
46
48
47
49
verify . codeFixAll ( {
@@ -66,5 +68,6 @@ verify.codeFixAll({
66
68
-0x20000000000001n;
67
69
2e52;
68
70
2e53;
69
- 2e54;`
71
+ 2e54;
72
+ 1e00000000010;`
70
73
} ) ;
You can’t perform that action at this time.
0 commit comments