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 {
3368933689 }
3369033690
3369133691 function checkNumericLiteralValueSize(node: NumericLiteral) {
33692+ // Scientific notation (e.g. 2e54 and 1e00000000010) can't be converted to bigint
3369233693 // Literals with 15 or fewer characters aren't long enough to reach past 2^53 - 1
3369333694 // 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) {
3369533696 return;
3369633697 }
3369733698
Original file line number Diff line number Diff line change 1818////2e52;
1919////2e53;
2020////2e54;
21+ ////1e00000000010;
2122
2223verify . codeFix ( {
2324 description : ts . Diagnostics . Convert_to_a_bigint_numeric_literal . message ,
@@ -41,7 +42,8 @@ verify.codeFix({
4142-0x20000000000001;
42432e52;
43442e53;
44- 2e54;`
45+ 2e54;
46+ 1e00000000010;`
4547} ) ;
4648
4749verify . codeFixAll ( {
@@ -66,5 +68,6 @@ verify.codeFixAll({
6668-0x20000000000001n;
67692e52;
68702e53;
69- 2e54;`
71+ 2e54;
72+ 1e00000000010;`
7073} ) ;
You can’t perform that action at this time.
0 commit comments