File tree Expand file tree Collapse file tree 4 files changed +26
-11
lines changed Expand file tree Collapse file tree 4 files changed +26
-11
lines changed Original file line number Diff line number Diff line change @@ -312,16 +312,6 @@ namespace ts {
312
312
let constraintDepth = 0;
313
313
let currentNode: Node | undefined;
314
314
315
- interface ExpensiveStatement {
316
- node: Node;
317
- typeDelta: number;
318
- symbolDelta: number;
319
- }
320
-
321
- let ignoreExpensiveStatement = true;
322
- const maxExpensiveStatementCount = 5;
323
- const expensiveStatements: ExpensiveStatement[] = [];
324
-
325
315
const emptySymbols = createSymbolTable();
326
316
const arrayVariances = [VarianceFlags.Covariant];
327
317
@@ -338,6 +328,16 @@ namespace ts {
338
328
const keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
339
329
const freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : ObjectFlags.FreshLiteral;
340
330
331
+ interface ExpensiveStatement {
332
+ node: Node;
333
+ typeDelta: number;
334
+ symbolDelta: number;
335
+ }
336
+
337
+ let ignoreExpensiveStatement = true;
338
+ const maxExpensiveStatementCount = compilerOptions.expensiveStatements ?? 0;
339
+ const expensiveStatements: ExpensiveStatement[] = [];
340
+
341
341
const emitResolver = createResolver();
342
342
const nodeBuilder = createNodeBuilder();
343
343
Original file line number Diff line number Diff line change @@ -218,6 +218,12 @@ namespace ts {
218
218
category : Diagnostics . Advanced_Options ,
219
219
description : Diagnostics . The_locale_used_when_displaying_messages_to_the_user_e_g_en_us
220
220
} ,
221
+ {
222
+ name : "expensiveStatements" ,
223
+ type : "number" ,
224
+ category : Diagnostics . Advanced_Options ,
225
+ description : Diagnostics . Heuristically_reports_statements_that_appear_to_contribute_disproportionately_to_check_time
226
+ } ,
221
227
] ;
222
228
223
229
/* @internal */
Original file line number Diff line number Diff line change 4388
4388
"category" : " Error" ,
4389
4389
"code" : 6231
4390
4390
},
4391
+ "Heuristically reports statements that appear to contribute disproportionately to check time." : {
4392
+ "category" : " Message" ,
4393
+ "code" : 6232
4394
+ },
4391
4395
4392
4396
"Projects to reference" : {
4393
4397
"category" : " Message" ,
5645
5649
"category" : " Message" ,
5646
5650
"code" : 95116
5647
5651
},
5648
-
5652
+
5649
5653
"No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer." : {
5650
5654
"category" : " Error" ,
5651
5655
"code" : 18004
5733
5737
"An optional chain cannot contain private identifiers." : {
5734
5738
"category" : " Error" ,
5735
5739
"code" : 18030
5740
+ },
5741
+ "Checking this statement may result in the creation of as many as {0} types and {1} symbols." : {
5742
+ "category" : " Warning" ,
5743
+ "code" : 19000
5736
5744
}
5737
5745
}
Original file line number Diff line number Diff line change @@ -5152,6 +5152,7 @@ namespace ts {
5152
5152
downlevelIteration ?: boolean ;
5153
5153
emitBOM ?: boolean ;
5154
5154
emitDecoratorMetadata ?: boolean ;
5155
+ /*@internal */ expensiveStatements ?: number ;
5155
5156
experimentalDecorators ?: boolean ;
5156
5157
forceConsistentCasingInFileNames ?: boolean ;
5157
5158
/*@internal */ generateCpuProfile ?: string ;
You can’t perform that action at this time.
0 commit comments