typescript 5.0.0-dev.20230209 → 5.0.0-dev.20230211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.decorators.d.ts +112 -95
- package/lib/tsc.js +624 -150
- package/lib/tsserver.js +649 -170
- package/lib/tsserverlibrary.d.ts +1 -1
- package/lib/tsserverlibrary.js +649 -170
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +649 -170
- package/lib/typingsInstaller.js +21 -5
- package/package.json +1 -1
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.0";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230211`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -7466,6 +7466,7 @@ ${lanes.join("\n")}
|
|
|
7466
7466
|
To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'),
|
|
7467
7467
|
_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1484, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484", "'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),
|
|
7468
7468
|
_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1485, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),
|
|
7469
|
+
Decorator_used_before_export_here: diag(1486, 1 /* Error */, "Decorator_used_before_export_here_1486", "Decorator used before 'export' here."),
|
|
7469
7470
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
7470
7471
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
7471
7472
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -8822,7 +8823,7 @@ ${lanes.join("\n")}
|
|
|
8822
8823
|
You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."),
|
|
8823
8824
|
You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."),
|
|
8824
8825
|
Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."),
|
|
8825
|
-
|
|
8826
|
+
Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export: diag(8038, 1 /* Error */, "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038", "Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."),
|
|
8826
8827
|
Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),
|
|
8827
8828
|
Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),
|
|
8828
8829
|
JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."),
|
|
@@ -13168,101 +13169,400 @@ ${lanes.join("\n")}
|
|
|
13168
13169
|
return emitNode && emitNode.internalFlags || 0;
|
|
13169
13170
|
}
|
|
13170
13171
|
function getScriptTargetFeatures() {
|
|
13171
|
-
return {
|
|
13172
|
-
|
|
13173
|
-
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
|
|
13182
|
-
|
|
13183
|
-
|
|
13184
|
-
|
|
13185
|
-
|
|
13186
|
-
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
|
|
13192
|
-
|
|
13193
|
-
|
|
13194
|
-
|
|
13195
|
-
|
|
13196
|
-
|
|
13197
|
-
|
|
13198
|
-
|
|
13199
|
-
|
|
13200
|
-
|
|
13201
|
-
|
|
13202
|
-
|
|
13203
|
-
|
|
13204
|
-
|
|
13205
|
-
|
|
13206
|
-
|
|
13207
|
-
|
|
13208
|
-
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
13230
|
-
|
|
13231
|
-
|
|
13232
|
-
|
|
13233
|
-
|
|
13234
|
-
|
|
13235
|
-
|
|
13236
|
-
|
|
13237
|
-
|
|
13238
|
-
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
|
|
13242
|
-
|
|
13243
|
-
|
|
13244
|
-
|
|
13245
|
-
|
|
13246
|
-
|
|
13247
|
-
|
|
13248
|
-
|
|
13249
|
-
|
|
13250
|
-
|
|
13251
|
-
|
|
13252
|
-
|
|
13253
|
-
|
|
13254
|
-
|
|
13255
|
-
|
|
13256
|
-
|
|
13257
|
-
|
|
13258
|
-
|
|
13259
|
-
|
|
13260
|
-
|
|
13261
|
-
|
|
13262
|
-
|
|
13263
|
-
|
|
13264
|
-
|
|
13265
|
-
|
|
13172
|
+
return new Map(Object.entries({
|
|
13173
|
+
Array: new Map(Object.entries({
|
|
13174
|
+
es2015: [
|
|
13175
|
+
"find",
|
|
13176
|
+
"findIndex",
|
|
13177
|
+
"fill",
|
|
13178
|
+
"copyWithin",
|
|
13179
|
+
"entries",
|
|
13180
|
+
"keys",
|
|
13181
|
+
"values"
|
|
13182
|
+
],
|
|
13183
|
+
es2016: [
|
|
13184
|
+
"includes"
|
|
13185
|
+
],
|
|
13186
|
+
es2019: [
|
|
13187
|
+
"flat",
|
|
13188
|
+
"flatMap"
|
|
13189
|
+
],
|
|
13190
|
+
es2022: [
|
|
13191
|
+
"at"
|
|
13192
|
+
],
|
|
13193
|
+
es2023: [
|
|
13194
|
+
"findLastIndex",
|
|
13195
|
+
"findLast"
|
|
13196
|
+
]
|
|
13197
|
+
})),
|
|
13198
|
+
Iterator: new Map(Object.entries({
|
|
13199
|
+
es2015: emptyArray
|
|
13200
|
+
})),
|
|
13201
|
+
AsyncIterator: new Map(Object.entries({
|
|
13202
|
+
es2015: emptyArray
|
|
13203
|
+
})),
|
|
13204
|
+
Atomics: new Map(Object.entries({
|
|
13205
|
+
es2017: emptyArray
|
|
13206
|
+
})),
|
|
13207
|
+
SharedArrayBuffer: new Map(Object.entries({
|
|
13208
|
+
es2017: emptyArray
|
|
13209
|
+
})),
|
|
13210
|
+
AsyncIterable: new Map(Object.entries({
|
|
13211
|
+
es2018: emptyArray
|
|
13212
|
+
})),
|
|
13213
|
+
AsyncIterableIterator: new Map(Object.entries({
|
|
13214
|
+
es2018: emptyArray
|
|
13215
|
+
})),
|
|
13216
|
+
AsyncGenerator: new Map(Object.entries({
|
|
13217
|
+
es2018: emptyArray
|
|
13218
|
+
})),
|
|
13219
|
+
AsyncGeneratorFunction: new Map(Object.entries({
|
|
13220
|
+
es2018: emptyArray
|
|
13221
|
+
})),
|
|
13222
|
+
RegExp: new Map(Object.entries({
|
|
13223
|
+
es2015: [
|
|
13224
|
+
"flags",
|
|
13225
|
+
"sticky",
|
|
13226
|
+
"unicode"
|
|
13227
|
+
],
|
|
13228
|
+
es2018: [
|
|
13229
|
+
"dotAll"
|
|
13230
|
+
]
|
|
13231
|
+
})),
|
|
13232
|
+
Reflect: new Map(Object.entries({
|
|
13233
|
+
es2015: [
|
|
13234
|
+
"apply",
|
|
13235
|
+
"construct",
|
|
13236
|
+
"defineProperty",
|
|
13237
|
+
"deleteProperty",
|
|
13238
|
+
"get",
|
|
13239
|
+
" getOwnPropertyDescriptor",
|
|
13240
|
+
"getPrototypeOf",
|
|
13241
|
+
"has",
|
|
13242
|
+
"isExtensible",
|
|
13243
|
+
"ownKeys",
|
|
13244
|
+
"preventExtensions",
|
|
13245
|
+
"set",
|
|
13246
|
+
"setPrototypeOf"
|
|
13247
|
+
]
|
|
13248
|
+
})),
|
|
13249
|
+
ArrayConstructor: new Map(Object.entries({
|
|
13250
|
+
es2015: [
|
|
13251
|
+
"from",
|
|
13252
|
+
"of"
|
|
13253
|
+
]
|
|
13254
|
+
})),
|
|
13255
|
+
ObjectConstructor: new Map(Object.entries({
|
|
13256
|
+
es2015: [
|
|
13257
|
+
"assign",
|
|
13258
|
+
"getOwnPropertySymbols",
|
|
13259
|
+
"keys",
|
|
13260
|
+
"is",
|
|
13261
|
+
"setPrototypeOf"
|
|
13262
|
+
],
|
|
13263
|
+
es2017: [
|
|
13264
|
+
"values",
|
|
13265
|
+
"entries",
|
|
13266
|
+
"getOwnPropertyDescriptors"
|
|
13267
|
+
],
|
|
13268
|
+
es2019: [
|
|
13269
|
+
"fromEntries"
|
|
13270
|
+
],
|
|
13271
|
+
es2022: [
|
|
13272
|
+
"hasOwn"
|
|
13273
|
+
]
|
|
13274
|
+
})),
|
|
13275
|
+
NumberConstructor: new Map(Object.entries({
|
|
13276
|
+
es2015: [
|
|
13277
|
+
"isFinite",
|
|
13278
|
+
"isInteger",
|
|
13279
|
+
"isNaN",
|
|
13280
|
+
"isSafeInteger",
|
|
13281
|
+
"parseFloat",
|
|
13282
|
+
"parseInt"
|
|
13283
|
+
]
|
|
13284
|
+
})),
|
|
13285
|
+
Math: new Map(Object.entries({
|
|
13286
|
+
es2015: [
|
|
13287
|
+
"clz32",
|
|
13288
|
+
"imul",
|
|
13289
|
+
"sign",
|
|
13290
|
+
"log10",
|
|
13291
|
+
"log2",
|
|
13292
|
+
"log1p",
|
|
13293
|
+
"expm1",
|
|
13294
|
+
"cosh",
|
|
13295
|
+
"sinh",
|
|
13296
|
+
"tanh",
|
|
13297
|
+
"acosh",
|
|
13298
|
+
"asinh",
|
|
13299
|
+
"atanh",
|
|
13300
|
+
"hypot",
|
|
13301
|
+
"trunc",
|
|
13302
|
+
"fround",
|
|
13303
|
+
"cbrt"
|
|
13304
|
+
]
|
|
13305
|
+
})),
|
|
13306
|
+
Map: new Map(Object.entries({
|
|
13307
|
+
es2015: [
|
|
13308
|
+
"entries",
|
|
13309
|
+
"keys",
|
|
13310
|
+
"values"
|
|
13311
|
+
]
|
|
13312
|
+
})),
|
|
13313
|
+
Set: new Map(Object.entries({
|
|
13314
|
+
es2015: [
|
|
13315
|
+
"entries",
|
|
13316
|
+
"keys",
|
|
13317
|
+
"values"
|
|
13318
|
+
]
|
|
13319
|
+
})),
|
|
13320
|
+
PromiseConstructor: new Map(Object.entries({
|
|
13321
|
+
es2015: [
|
|
13322
|
+
"all",
|
|
13323
|
+
"race",
|
|
13324
|
+
"reject",
|
|
13325
|
+
"resolve"
|
|
13326
|
+
],
|
|
13327
|
+
es2020: [
|
|
13328
|
+
"allSettled"
|
|
13329
|
+
],
|
|
13330
|
+
es2021: [
|
|
13331
|
+
"any"
|
|
13332
|
+
]
|
|
13333
|
+
})),
|
|
13334
|
+
Symbol: new Map(Object.entries({
|
|
13335
|
+
es2015: [
|
|
13336
|
+
"for",
|
|
13337
|
+
"keyFor"
|
|
13338
|
+
],
|
|
13339
|
+
es2019: [
|
|
13340
|
+
"description"
|
|
13341
|
+
]
|
|
13342
|
+
})),
|
|
13343
|
+
WeakMap: new Map(Object.entries({
|
|
13344
|
+
es2015: [
|
|
13345
|
+
"entries",
|
|
13346
|
+
"keys",
|
|
13347
|
+
"values"
|
|
13348
|
+
]
|
|
13349
|
+
})),
|
|
13350
|
+
WeakSet: new Map(Object.entries({
|
|
13351
|
+
es2015: [
|
|
13352
|
+
"entries",
|
|
13353
|
+
"keys",
|
|
13354
|
+
"values"
|
|
13355
|
+
]
|
|
13356
|
+
})),
|
|
13357
|
+
String: new Map(Object.entries({
|
|
13358
|
+
es2015: [
|
|
13359
|
+
"codePointAt",
|
|
13360
|
+
"includes",
|
|
13361
|
+
"endsWith",
|
|
13362
|
+
"normalize",
|
|
13363
|
+
"repeat",
|
|
13364
|
+
"startsWith",
|
|
13365
|
+
"anchor",
|
|
13366
|
+
"big",
|
|
13367
|
+
"blink",
|
|
13368
|
+
"bold",
|
|
13369
|
+
"fixed",
|
|
13370
|
+
"fontcolor",
|
|
13371
|
+
"fontsize",
|
|
13372
|
+
"italics",
|
|
13373
|
+
"link",
|
|
13374
|
+
"small",
|
|
13375
|
+
"strike",
|
|
13376
|
+
"sub",
|
|
13377
|
+
"sup"
|
|
13378
|
+
],
|
|
13379
|
+
es2017: [
|
|
13380
|
+
"padStart",
|
|
13381
|
+
"padEnd"
|
|
13382
|
+
],
|
|
13383
|
+
es2019: [
|
|
13384
|
+
"trimStart",
|
|
13385
|
+
"trimEnd",
|
|
13386
|
+
"trimLeft",
|
|
13387
|
+
"trimRight"
|
|
13388
|
+
],
|
|
13389
|
+
es2020: [
|
|
13390
|
+
"matchAll"
|
|
13391
|
+
],
|
|
13392
|
+
es2021: [
|
|
13393
|
+
"replaceAll"
|
|
13394
|
+
],
|
|
13395
|
+
es2022: [
|
|
13396
|
+
"at"
|
|
13397
|
+
]
|
|
13398
|
+
})),
|
|
13399
|
+
StringConstructor: new Map(Object.entries({
|
|
13400
|
+
es2015: [
|
|
13401
|
+
"fromCodePoint",
|
|
13402
|
+
"raw"
|
|
13403
|
+
]
|
|
13404
|
+
})),
|
|
13405
|
+
DateTimeFormat: new Map(Object.entries({
|
|
13406
|
+
es2017: [
|
|
13407
|
+
"formatToParts"
|
|
13408
|
+
]
|
|
13409
|
+
})),
|
|
13410
|
+
Promise: new Map(Object.entries({
|
|
13411
|
+
es2015: emptyArray,
|
|
13412
|
+
es2018: [
|
|
13413
|
+
"finally"
|
|
13414
|
+
]
|
|
13415
|
+
})),
|
|
13416
|
+
RegExpMatchArray: new Map(Object.entries({
|
|
13417
|
+
es2018: [
|
|
13418
|
+
"groups"
|
|
13419
|
+
]
|
|
13420
|
+
})),
|
|
13421
|
+
RegExpExecArray: new Map(Object.entries({
|
|
13422
|
+
es2018: [
|
|
13423
|
+
"groups"
|
|
13424
|
+
]
|
|
13425
|
+
})),
|
|
13426
|
+
Intl: new Map(Object.entries({
|
|
13427
|
+
es2018: [
|
|
13428
|
+
"PluralRules"
|
|
13429
|
+
]
|
|
13430
|
+
})),
|
|
13431
|
+
NumberFormat: new Map(Object.entries({
|
|
13432
|
+
es2018: [
|
|
13433
|
+
"formatToParts"
|
|
13434
|
+
]
|
|
13435
|
+
})),
|
|
13436
|
+
SymbolConstructor: new Map(Object.entries({
|
|
13437
|
+
es2020: [
|
|
13438
|
+
"matchAll"
|
|
13439
|
+
]
|
|
13440
|
+
})),
|
|
13441
|
+
DataView: new Map(Object.entries({
|
|
13442
|
+
es2020: [
|
|
13443
|
+
"setBigInt64",
|
|
13444
|
+
"setBigUint64",
|
|
13445
|
+
"getBigInt64",
|
|
13446
|
+
"getBigUint64"
|
|
13447
|
+
]
|
|
13448
|
+
})),
|
|
13449
|
+
BigInt: new Map(Object.entries({
|
|
13450
|
+
es2020: emptyArray
|
|
13451
|
+
})),
|
|
13452
|
+
RelativeTimeFormat: new Map(Object.entries({
|
|
13453
|
+
es2020: [
|
|
13454
|
+
"format",
|
|
13455
|
+
"formatToParts",
|
|
13456
|
+
"resolvedOptions"
|
|
13457
|
+
]
|
|
13458
|
+
})),
|
|
13459
|
+
Int8Array: new Map(Object.entries({
|
|
13460
|
+
es2022: [
|
|
13461
|
+
"at"
|
|
13462
|
+
],
|
|
13463
|
+
es2023: [
|
|
13464
|
+
"findLastIndex",
|
|
13465
|
+
"findLast"
|
|
13466
|
+
]
|
|
13467
|
+
})),
|
|
13468
|
+
Uint8Array: new Map(Object.entries({
|
|
13469
|
+
es2022: [
|
|
13470
|
+
"at"
|
|
13471
|
+
],
|
|
13472
|
+
es2023: [
|
|
13473
|
+
"findLastIndex",
|
|
13474
|
+
"findLast"
|
|
13475
|
+
]
|
|
13476
|
+
})),
|
|
13477
|
+
Uint8ClampedArray: new Map(Object.entries({
|
|
13478
|
+
es2022: [
|
|
13479
|
+
"at"
|
|
13480
|
+
],
|
|
13481
|
+
es2023: [
|
|
13482
|
+
"findLastIndex",
|
|
13483
|
+
"findLast"
|
|
13484
|
+
]
|
|
13485
|
+
})),
|
|
13486
|
+
Int16Array: new Map(Object.entries({
|
|
13487
|
+
es2022: [
|
|
13488
|
+
"at"
|
|
13489
|
+
],
|
|
13490
|
+
es2023: [
|
|
13491
|
+
"findLastIndex",
|
|
13492
|
+
"findLast"
|
|
13493
|
+
]
|
|
13494
|
+
})),
|
|
13495
|
+
Uint16Array: new Map(Object.entries({
|
|
13496
|
+
es2022: [
|
|
13497
|
+
"at"
|
|
13498
|
+
],
|
|
13499
|
+
es2023: [
|
|
13500
|
+
"findLastIndex",
|
|
13501
|
+
"findLast"
|
|
13502
|
+
]
|
|
13503
|
+
})),
|
|
13504
|
+
Int32Array: new Map(Object.entries({
|
|
13505
|
+
es2022: [
|
|
13506
|
+
"at"
|
|
13507
|
+
],
|
|
13508
|
+
es2023: [
|
|
13509
|
+
"findLastIndex",
|
|
13510
|
+
"findLast"
|
|
13511
|
+
]
|
|
13512
|
+
})),
|
|
13513
|
+
Uint32Array: new Map(Object.entries({
|
|
13514
|
+
es2022: [
|
|
13515
|
+
"at"
|
|
13516
|
+
],
|
|
13517
|
+
es2023: [
|
|
13518
|
+
"findLastIndex",
|
|
13519
|
+
"findLast"
|
|
13520
|
+
]
|
|
13521
|
+
})),
|
|
13522
|
+
Float32Array: new Map(Object.entries({
|
|
13523
|
+
es2022: [
|
|
13524
|
+
"at"
|
|
13525
|
+
],
|
|
13526
|
+
es2023: [
|
|
13527
|
+
"findLastIndex",
|
|
13528
|
+
"findLast"
|
|
13529
|
+
]
|
|
13530
|
+
})),
|
|
13531
|
+
Float64Array: new Map(Object.entries({
|
|
13532
|
+
es2022: [
|
|
13533
|
+
"at"
|
|
13534
|
+
],
|
|
13535
|
+
es2023: [
|
|
13536
|
+
"findLastIndex",
|
|
13537
|
+
"findLast"
|
|
13538
|
+
]
|
|
13539
|
+
})),
|
|
13540
|
+
BigInt64Array: new Map(Object.entries({
|
|
13541
|
+
es2020: emptyArray,
|
|
13542
|
+
es2022: [
|
|
13543
|
+
"at"
|
|
13544
|
+
],
|
|
13545
|
+
es2023: [
|
|
13546
|
+
"findLastIndex",
|
|
13547
|
+
"findLast"
|
|
13548
|
+
]
|
|
13549
|
+
})),
|
|
13550
|
+
BigUint64Array: new Map(Object.entries({
|
|
13551
|
+
es2020: emptyArray,
|
|
13552
|
+
es2022: [
|
|
13553
|
+
"at"
|
|
13554
|
+
],
|
|
13555
|
+
es2023: [
|
|
13556
|
+
"findLastIndex",
|
|
13557
|
+
"findLast"
|
|
13558
|
+
]
|
|
13559
|
+
})),
|
|
13560
|
+
Error: new Map(Object.entries({
|
|
13561
|
+
es2022: [
|
|
13562
|
+
"cause"
|
|
13563
|
+
]
|
|
13564
|
+
}))
|
|
13565
|
+
}));
|
|
13266
13566
|
}
|
|
13267
13567
|
function getLiteralText(node, sourceFile, flags) {
|
|
13268
13568
|
var _a2;
|
|
@@ -24552,14 +24852,114 @@ ${lanes.join("\n")}
|
|
|
24552
24852
|
factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name)
|
|
24553
24853
|
]);
|
|
24554
24854
|
}
|
|
24855
|
+
function createESDecorateClassElementAccessGetMethod(elementName) {
|
|
24856
|
+
const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name);
|
|
24857
|
+
return factory2.createPropertyAssignment(
|
|
24858
|
+
"get",
|
|
24859
|
+
factory2.createArrowFunction(
|
|
24860
|
+
/*modifiers*/
|
|
24861
|
+
void 0,
|
|
24862
|
+
/*typeParameters*/
|
|
24863
|
+
void 0,
|
|
24864
|
+
[factory2.createParameterDeclaration(
|
|
24865
|
+
/*modifiers*/
|
|
24866
|
+
void 0,
|
|
24867
|
+
/*dotDotDotToken*/
|
|
24868
|
+
void 0,
|
|
24869
|
+
factory2.createIdentifier("obj")
|
|
24870
|
+
)],
|
|
24871
|
+
/*type*/
|
|
24872
|
+
void 0,
|
|
24873
|
+
/*equalsGreaterThanToken*/
|
|
24874
|
+
void 0,
|
|
24875
|
+
accessor
|
|
24876
|
+
)
|
|
24877
|
+
);
|
|
24878
|
+
}
|
|
24879
|
+
function createESDecorateClassElementAccessSetMethod(elementName) {
|
|
24880
|
+
const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name);
|
|
24881
|
+
return factory2.createPropertyAssignment(
|
|
24882
|
+
"set",
|
|
24883
|
+
factory2.createArrowFunction(
|
|
24884
|
+
/*modifiers*/
|
|
24885
|
+
void 0,
|
|
24886
|
+
/*typeParameters*/
|
|
24887
|
+
void 0,
|
|
24888
|
+
[
|
|
24889
|
+
factory2.createParameterDeclaration(
|
|
24890
|
+
/*modifiers*/
|
|
24891
|
+
void 0,
|
|
24892
|
+
/*dotDotDotToken*/
|
|
24893
|
+
void 0,
|
|
24894
|
+
factory2.createIdentifier("obj")
|
|
24895
|
+
),
|
|
24896
|
+
factory2.createParameterDeclaration(
|
|
24897
|
+
/*modifiers*/
|
|
24898
|
+
void 0,
|
|
24899
|
+
/*dotDotDotToken*/
|
|
24900
|
+
void 0,
|
|
24901
|
+
factory2.createIdentifier("value")
|
|
24902
|
+
)
|
|
24903
|
+
],
|
|
24904
|
+
/*type*/
|
|
24905
|
+
void 0,
|
|
24906
|
+
/*equalsGreaterThanToken*/
|
|
24907
|
+
void 0,
|
|
24908
|
+
factory2.createBlock([
|
|
24909
|
+
factory2.createExpressionStatement(
|
|
24910
|
+
factory2.createAssignment(
|
|
24911
|
+
accessor,
|
|
24912
|
+
factory2.createIdentifier("value")
|
|
24913
|
+
)
|
|
24914
|
+
)
|
|
24915
|
+
])
|
|
24916
|
+
)
|
|
24917
|
+
);
|
|
24918
|
+
}
|
|
24919
|
+
function createESDecorateClassElementAccessHasMethod(elementName) {
|
|
24920
|
+
const propertyName = elementName.computed ? elementName.name : isIdentifier(elementName.name) ? factory2.createStringLiteralFromNode(elementName.name) : elementName.name;
|
|
24921
|
+
return factory2.createPropertyAssignment(
|
|
24922
|
+
"has",
|
|
24923
|
+
factory2.createArrowFunction(
|
|
24924
|
+
/*modifiers*/
|
|
24925
|
+
void 0,
|
|
24926
|
+
/*typeParameters*/
|
|
24927
|
+
void 0,
|
|
24928
|
+
[factory2.createParameterDeclaration(
|
|
24929
|
+
/*modifiers*/
|
|
24930
|
+
void 0,
|
|
24931
|
+
/*dotDotDotToken*/
|
|
24932
|
+
void 0,
|
|
24933
|
+
factory2.createIdentifier("obj")
|
|
24934
|
+
)],
|
|
24935
|
+
/*type*/
|
|
24936
|
+
void 0,
|
|
24937
|
+
/*equalsGreaterThanToken*/
|
|
24938
|
+
void 0,
|
|
24939
|
+
factory2.createBinaryExpression(
|
|
24940
|
+
propertyName,
|
|
24941
|
+
101 /* InKeyword */,
|
|
24942
|
+
factory2.createIdentifier("obj")
|
|
24943
|
+
)
|
|
24944
|
+
)
|
|
24945
|
+
);
|
|
24946
|
+
}
|
|
24947
|
+
function createESDecorateClassElementAccessObject(name, access) {
|
|
24948
|
+
const properties = [];
|
|
24949
|
+
properties.push(createESDecorateClassElementAccessHasMethod(name));
|
|
24950
|
+
if (access.get)
|
|
24951
|
+
properties.push(createESDecorateClassElementAccessGetMethod(name));
|
|
24952
|
+
if (access.set)
|
|
24953
|
+
properties.push(createESDecorateClassElementAccessSetMethod(name));
|
|
24954
|
+
return factory2.createObjectLiteralExpression(properties);
|
|
24955
|
+
}
|
|
24555
24956
|
function createESDecorateClassElementContextObject(contextIn) {
|
|
24556
24957
|
return factory2.createObjectLiteralExpression([
|
|
24557
24958
|
factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral(contextIn.kind)),
|
|
24558
24959
|
factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name.computed ? contextIn.name.name : factory2.createStringLiteralFromNode(contextIn.name.name)),
|
|
24559
24960
|
factory2.createPropertyAssignment(factory2.createIdentifier("static"), contextIn.static ? factory2.createTrue() : factory2.createFalse()),
|
|
24560
|
-
factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse())
|
|
24561
|
-
|
|
24562
|
-
// factory.createPropertyAssignment(factory.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access))
|
|
24961
|
+
factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()),
|
|
24962
|
+
factory2.createPropertyAssignment(factory2.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access))
|
|
24563
24963
|
]);
|
|
24564
24964
|
}
|
|
24565
24965
|
function createESDecorateContextObject(contextIn) {
|
|
@@ -31254,6 +31654,12 @@ ${lanes.join("\n")}
|
|
|
31254
31654
|
case 114 /* VoidKeyword */:
|
|
31255
31655
|
return parseVoidExpression();
|
|
31256
31656
|
case 29 /* LessThanToken */:
|
|
31657
|
+
if (languageVariant === 1 /* JSX */) {
|
|
31658
|
+
return parseJsxElementOrSelfClosingElementOrFragment(
|
|
31659
|
+
/*inExpressionContext*/
|
|
31660
|
+
true
|
|
31661
|
+
);
|
|
31662
|
+
}
|
|
31257
31663
|
return parseTypeAssertion();
|
|
31258
31664
|
case 133 /* AwaitKeyword */:
|
|
31259
31665
|
if (isAwaitExpression2()) {
|
|
@@ -31625,6 +32031,7 @@ ${lanes.join("\n")}
|
|
|
31625
32031
|
return finishNode(factory2.createJsxJsxClosingFragment(), pos);
|
|
31626
32032
|
}
|
|
31627
32033
|
function parseTypeAssertion() {
|
|
32034
|
+
Debug.assert(scriptKind === 3 /* TS */, "Type assertions should never be parsed outside of TS; they should either be comparisons or JSX.");
|
|
31628
32035
|
const pos = getNodePos();
|
|
31629
32036
|
parseExpected(29 /* LessThanToken */);
|
|
31630
32037
|
const type = parseType();
|
|
@@ -32975,17 +33382,25 @@ ${lanes.join("\n")}
|
|
|
32975
33382
|
function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) {
|
|
32976
33383
|
const pos = getNodePos();
|
|
32977
33384
|
let list;
|
|
32978
|
-
let modifier, hasSeenStaticModifier = false;
|
|
33385
|
+
let decorator, modifier, hasSeenStaticModifier = false, hasLeadingModifier = false, hasTrailingDecorator = false;
|
|
33386
|
+
if (allowDecorators && token() === 59 /* AtToken */) {
|
|
33387
|
+
while (decorator = tryParseDecorator()) {
|
|
33388
|
+
list = append(list, decorator);
|
|
33389
|
+
}
|
|
33390
|
+
}
|
|
32979
33391
|
while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) {
|
|
32980
33392
|
if (modifier.kind === 124 /* StaticKeyword */)
|
|
32981
33393
|
hasSeenStaticModifier = true;
|
|
32982
33394
|
list = append(list, modifier);
|
|
33395
|
+
hasLeadingModifier = true;
|
|
32983
33396
|
}
|
|
32984
|
-
if (allowDecorators && token() === 59 /* AtToken */) {
|
|
32985
|
-
let decorator;
|
|
33397
|
+
if (hasLeadingModifier && allowDecorators && token() === 59 /* AtToken */) {
|
|
32986
33398
|
while (decorator = tryParseDecorator()) {
|
|
32987
33399
|
list = append(list, decorator);
|
|
33400
|
+
hasTrailingDecorator = true;
|
|
32988
33401
|
}
|
|
33402
|
+
}
|
|
33403
|
+
if (hasTrailingDecorator) {
|
|
32989
33404
|
while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) {
|
|
32990
33405
|
if (modifier.kind === 124 /* StaticKeyword */)
|
|
32991
33406
|
hasSeenStaticModifier = true;
|
|
@@ -45266,6 +45681,7 @@ ${lanes.join("\n")}
|
|
|
45266
45681
|
let flowTypeCache;
|
|
45267
45682
|
const contextualTypeNodes = [];
|
|
45268
45683
|
const contextualTypes = [];
|
|
45684
|
+
const contextualIsCache = [];
|
|
45269
45685
|
let contextualTypeCount = 0;
|
|
45270
45686
|
const inferenceContextNodes = [];
|
|
45271
45687
|
const inferenceContexts = [];
|
|
@@ -57702,7 +58118,7 @@ ${lanes.join("\n")}
|
|
|
57702
58118
|
}
|
|
57703
58119
|
}
|
|
57704
58120
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
57705
|
-
const templates = filter(types, isPatternLiteralType);
|
|
58121
|
+
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
|
|
57706
58122
|
if (templates.length) {
|
|
57707
58123
|
let i = types.length;
|
|
57708
58124
|
while (i > 0) {
|
|
@@ -60227,7 +60643,12 @@ ${lanes.join("\n")}
|
|
|
60227
60643
|
}
|
|
60228
60644
|
}
|
|
60229
60645
|
function checkExpressionForMutableLocationWithContextualType(next, sourcePropType) {
|
|
60230
|
-
pushContextualType(
|
|
60646
|
+
pushContextualType(
|
|
60647
|
+
next,
|
|
60648
|
+
sourcePropType,
|
|
60649
|
+
/*isCache*/
|
|
60650
|
+
false
|
|
60651
|
+
);
|
|
60231
60652
|
const result = checkExpressionForMutableLocation(next, 1 /* Contextual */);
|
|
60232
60653
|
popContextualType();
|
|
60233
60654
|
return result;
|
|
@@ -60535,7 +60956,12 @@ ${lanes.join("\n")}
|
|
|
60535
60956
|
if (isTupleLikeType(source)) {
|
|
60536
60957
|
return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer);
|
|
60537
60958
|
}
|
|
60538
|
-
pushContextualType(
|
|
60959
|
+
pushContextualType(
|
|
60960
|
+
node,
|
|
60961
|
+
target,
|
|
60962
|
+
/*isCache*/
|
|
60963
|
+
false
|
|
60964
|
+
);
|
|
60539
60965
|
const tupleizedType = checkArrayLiteral(
|
|
60540
60966
|
node,
|
|
60541
60967
|
1 /* Contextual */,
|
|
@@ -66225,10 +66651,12 @@ ${lanes.join("\n")}
|
|
|
66225
66651
|
}
|
|
66226
66652
|
function isConstantReference(node) {
|
|
66227
66653
|
switch (node.kind) {
|
|
66228
|
-
case 79 /* Identifier */:
|
|
66229
|
-
|
|
66230
|
-
|
|
66231
|
-
|
|
66654
|
+
case 79 /* Identifier */:
|
|
66655
|
+
if (!isThisInTypeQuery(node)) {
|
|
66656
|
+
const symbol = getResolvedSymbol(node);
|
|
66657
|
+
return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
|
|
66658
|
+
}
|
|
66659
|
+
break;
|
|
66232
66660
|
case 208 /* PropertyAccessExpression */:
|
|
66233
66661
|
case 209 /* ElementAccessExpression */:
|
|
66234
66662
|
return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol);
|
|
@@ -68582,11 +69010,13 @@ ${lanes.join("\n")}
|
|
|
68582
69010
|
if (node.flags & 33554432 /* InWithStatement */) {
|
|
68583
69011
|
return void 0;
|
|
68584
69012
|
}
|
|
68585
|
-
const index = findContextualNode(
|
|
69013
|
+
const index = findContextualNode(
|
|
69014
|
+
node,
|
|
69015
|
+
/*includeCaches*/
|
|
69016
|
+
!contextFlags
|
|
69017
|
+
);
|
|
68586
69018
|
if (index >= 0) {
|
|
68587
|
-
|
|
68588
|
-
if (cached || !contextFlags)
|
|
68589
|
-
return cached;
|
|
69019
|
+
return contextualTypes[index];
|
|
68590
69020
|
}
|
|
68591
69021
|
const { parent: parent2 } = node;
|
|
68592
69022
|
switch (parent2.kind) {
|
|
@@ -68657,17 +69087,30 @@ ${lanes.join("\n")}
|
|
|
68657
69087
|
}
|
|
68658
69088
|
return void 0;
|
|
68659
69089
|
}
|
|
68660
|
-
function
|
|
69090
|
+
function pushCachedContextualType(node) {
|
|
69091
|
+
pushContextualType(
|
|
69092
|
+
node,
|
|
69093
|
+
getContextualType2(
|
|
69094
|
+
node,
|
|
69095
|
+
/*contextFlags*/
|
|
69096
|
+
void 0
|
|
69097
|
+
),
|
|
69098
|
+
/*isCache*/
|
|
69099
|
+
true
|
|
69100
|
+
);
|
|
69101
|
+
}
|
|
69102
|
+
function pushContextualType(node, type, isCache) {
|
|
68661
69103
|
contextualTypeNodes[contextualTypeCount] = node;
|
|
68662
69104
|
contextualTypes[contextualTypeCount] = type;
|
|
69105
|
+
contextualIsCache[contextualTypeCount] = isCache;
|
|
68663
69106
|
contextualTypeCount++;
|
|
68664
69107
|
}
|
|
68665
69108
|
function popContextualType() {
|
|
68666
69109
|
contextualTypeCount--;
|
|
68667
69110
|
}
|
|
68668
|
-
function findContextualNode(node) {
|
|
69111
|
+
function findContextualNode(node, includeCaches) {
|
|
68669
69112
|
for (let i = contextualTypeCount - 1; i >= 0; i--) {
|
|
68670
|
-
if (node === contextualTypeNodes[i]) {
|
|
69113
|
+
if (node === contextualTypeNodes[i] && (includeCaches || !contextualIsCache[i])) {
|
|
68671
69114
|
return i;
|
|
68672
69115
|
}
|
|
68673
69116
|
}
|
|
@@ -68690,7 +69133,11 @@ ${lanes.join("\n")}
|
|
|
68690
69133
|
}
|
|
68691
69134
|
function getContextualJsxElementAttributesType(node, contextFlags) {
|
|
68692
69135
|
if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) {
|
|
68693
|
-
const index = findContextualNode(
|
|
69136
|
+
const index = findContextualNode(
|
|
69137
|
+
node.parent,
|
|
69138
|
+
/*includeCaches*/
|
|
69139
|
+
!contextFlags
|
|
69140
|
+
);
|
|
68694
69141
|
if (index >= 0) {
|
|
68695
69142
|
return contextualTypes[index];
|
|
68696
69143
|
}
|
|
@@ -68961,11 +69408,7 @@ ${lanes.join("\n")}
|
|
|
68961
69408
|
const elementCount = elements.length;
|
|
68962
69409
|
const elementTypes = [];
|
|
68963
69410
|
const elementFlags = [];
|
|
68964
|
-
|
|
68965
|
-
node,
|
|
68966
|
-
/*contextFlags*/
|
|
68967
|
-
void 0
|
|
68968
|
-
));
|
|
69411
|
+
pushCachedContextualType(node);
|
|
68969
69412
|
const inDestructuringPattern = isAssignmentTarget(node);
|
|
68970
69413
|
const inConstContext = isConstContext(node);
|
|
68971
69414
|
const contextualType = getApparentTypeOfContextualType(
|
|
@@ -69128,11 +69571,7 @@ ${lanes.join("\n")}
|
|
|
69128
69571
|
let propertiesTable = createSymbolTable();
|
|
69129
69572
|
let propertiesArray = [];
|
|
69130
69573
|
let spread = emptyObjectType;
|
|
69131
|
-
|
|
69132
|
-
node,
|
|
69133
|
-
/*contextFlags*/
|
|
69134
|
-
void 0
|
|
69135
|
-
));
|
|
69574
|
+
pushCachedContextualType(node);
|
|
69136
69575
|
const contextualType = getApparentTypeOfContextualType(
|
|
69137
69576
|
node,
|
|
69138
69577
|
/*contextFlags*/
|
|
@@ -70472,26 +70911,22 @@ ${lanes.join("\n")}
|
|
|
70472
70911
|
function getSuggestedLibForNonExistentName(name) {
|
|
70473
70912
|
const missingName = diagnosticName(name);
|
|
70474
70913
|
const allFeatures = getScriptTargetFeatures();
|
|
70475
|
-
const
|
|
70476
|
-
|
|
70477
|
-
const containingTypes = getOwnKeys(allFeatures[libTarget]);
|
|
70478
|
-
if (containingTypes !== void 0 && contains(containingTypes, missingName)) {
|
|
70479
|
-
return libTarget;
|
|
70480
|
-
}
|
|
70481
|
-
}
|
|
70914
|
+
const typeFeatures = allFeatures.get(missingName);
|
|
70915
|
+
return typeFeatures && firstIterator(typeFeatures.keys());
|
|
70482
70916
|
}
|
|
70483
70917
|
function getSuggestedLibForNonExistentProperty(missingProperty, containingType) {
|
|
70484
70918
|
const container = getApparentType(containingType).symbol;
|
|
70485
70919
|
if (!container) {
|
|
70486
70920
|
return void 0;
|
|
70487
70921
|
}
|
|
70922
|
+
const containingTypeName = symbolName(container);
|
|
70488
70923
|
const allFeatures = getScriptTargetFeatures();
|
|
70489
|
-
const
|
|
70490
|
-
|
|
70491
|
-
const
|
|
70492
|
-
|
|
70493
|
-
|
|
70494
|
-
|
|
70924
|
+
const typeFeatures = allFeatures.get(containingTypeName);
|
|
70925
|
+
if (typeFeatures) {
|
|
70926
|
+
for (const [libTarget, featuresOfType] of typeFeatures) {
|
|
70927
|
+
if (contains(featuresOfType, missingProperty)) {
|
|
70928
|
+
return libTarget;
|
|
70929
|
+
}
|
|
70495
70930
|
}
|
|
70496
70931
|
}
|
|
70497
70932
|
}
|
|
@@ -75147,14 +75582,19 @@ ${lanes.join("\n")}
|
|
|
75147
75582
|
return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */));
|
|
75148
75583
|
}
|
|
75149
75584
|
function getContextNode2(node) {
|
|
75150
|
-
if (node
|
|
75585
|
+
if (isJsxAttributes(node) && !isJsxSelfClosingElement(node.parent)) {
|
|
75151
75586
|
return node.parent.parent;
|
|
75152
75587
|
}
|
|
75153
75588
|
return node;
|
|
75154
75589
|
}
|
|
75155
75590
|
function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) {
|
|
75156
75591
|
const contextNode = getContextNode2(node);
|
|
75157
|
-
pushContextualType(
|
|
75592
|
+
pushContextualType(
|
|
75593
|
+
contextNode,
|
|
75594
|
+
contextualType,
|
|
75595
|
+
/*isCache*/
|
|
75596
|
+
false
|
|
75597
|
+
);
|
|
75158
75598
|
pushInferenceContext(contextNode, inferenceContext);
|
|
75159
75599
|
const type = checkExpression(node, checkMode | 1 /* Contextual */ | (inferenceContext ? 2 /* Inferential */ : 0));
|
|
75160
75600
|
if (inferenceContext && inferenceContext.intraExpressionInferenceSites) {
|
|
@@ -75495,7 +75935,12 @@ ${lanes.join("\n")}
|
|
|
75495
75935
|
if (links.contextFreeType) {
|
|
75496
75936
|
return links.contextFreeType;
|
|
75497
75937
|
}
|
|
75498
|
-
pushContextualType(
|
|
75938
|
+
pushContextualType(
|
|
75939
|
+
node,
|
|
75940
|
+
anyType,
|
|
75941
|
+
/*isCache*/
|
|
75942
|
+
false
|
|
75943
|
+
);
|
|
75499
75944
|
const type = links.contextFreeType = checkExpression(node, 4 /* SkipContextSensitive */);
|
|
75500
75945
|
popContextualType();
|
|
75501
75946
|
return type;
|
|
@@ -82949,6 +83394,7 @@ ${lanes.join("\n")}
|
|
|
82949
83394
|
let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator;
|
|
82950
83395
|
let flags = 0 /* None */;
|
|
82951
83396
|
let sawExportBeforeDecorators = false;
|
|
83397
|
+
let hasLeadingDecorators = false;
|
|
82952
83398
|
for (const modifier of node.modifiers) {
|
|
82953
83399
|
if (isDecorator(modifier)) {
|
|
82954
83400
|
if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) {
|
|
@@ -82966,8 +83412,22 @@ ${lanes.join("\n")}
|
|
|
82966
83412
|
if (flags & ~(1025 /* ExportDefault */ | 131072 /* Decorator */)) {
|
|
82967
83413
|
return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here);
|
|
82968
83414
|
}
|
|
83415
|
+
if (hasLeadingDecorators && flags & 126975 /* Modifier */) {
|
|
83416
|
+
Debug.assertIsDefined(firstDecorator);
|
|
83417
|
+
const sourceFile = getSourceFileOfNode(modifier);
|
|
83418
|
+
if (!hasParseDiagnostics(sourceFile)) {
|
|
83419
|
+
addRelatedInfo(
|
|
83420
|
+
error(modifier, Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),
|
|
83421
|
+
createDiagnosticForNode(firstDecorator, Diagnostics.Decorator_used_before_export_here)
|
|
83422
|
+
);
|
|
83423
|
+
return true;
|
|
83424
|
+
}
|
|
83425
|
+
return false;
|
|
83426
|
+
}
|
|
82969
83427
|
flags |= 131072 /* Decorator */;
|
|
82970
|
-
if (flags &
|
|
83428
|
+
if (!(flags & 126975 /* Modifier */)) {
|
|
83429
|
+
hasLeadingDecorators = true;
|
|
83430
|
+
} else if (flags & 1 /* Export */) {
|
|
82971
83431
|
sawExportBeforeDecorators = true;
|
|
82972
83432
|
}
|
|
82973
83433
|
firstDecorator != null ? firstDecorator : firstDecorator = modifier;
|
|
@@ -116338,11 +116798,19 @@ ${lanes.join("\n")}
|
|
|
116338
116798
|
diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
|
|
116339
116799
|
} else if (isClassDeclaration(parent2)) {
|
|
116340
116800
|
const exportIndex = findIndex(parent2.modifiers, isExportModifier);
|
|
116341
|
-
|
|
116342
|
-
|
|
116343
|
-
|
|
116344
|
-
|
|
116345
|
-
|
|
116801
|
+
if (exportIndex >= 0) {
|
|
116802
|
+
const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier);
|
|
116803
|
+
if (decoratorIndex > exportIndex && defaultIndex >= 0 && decoratorIndex < defaultIndex) {
|
|
116804
|
+
diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
|
|
116805
|
+
} else if (exportIndex >= 0 && decoratorIndex < exportIndex) {
|
|
116806
|
+
const trailingDecoratorIndex = findIndex(parent2.modifiers, isDecorator, exportIndex);
|
|
116807
|
+
if (trailingDecoratorIndex >= 0) {
|
|
116808
|
+
diagnostics.push(addRelatedInfo(
|
|
116809
|
+
createDiagnosticForNode2(parent2.modifiers[trailingDecoratorIndex], Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),
|
|
116810
|
+
createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorator_used_before_export_here)
|
|
116811
|
+
));
|
|
116812
|
+
}
|
|
116813
|
+
}
|
|
116346
116814
|
}
|
|
116347
116815
|
}
|
|
116348
116816
|
}
|
|
@@ -127736,10 +128204,13 @@ ${lanes.join("\n")}
|
|
|
127736
128204
|
return !(symbol.flags & 33554432 /* Transient */) && (symbol.escapedName === "export=" /* ExportEquals */ || symbol.escapedName === "default" /* Default */);
|
|
127737
128205
|
}
|
|
127738
128206
|
function getDefaultLikeExportNameFromDeclaration(symbol) {
|
|
127739
|
-
return firstDefined(
|
|
127740
|
-
|
|
127741
|
-
|
|
127742
|
-
|
|
128207
|
+
return firstDefined(
|
|
128208
|
+
symbol.declarations,
|
|
128209
|
+
(d) => {
|
|
128210
|
+
var _a2, _b;
|
|
128211
|
+
return isExportAssignment(d) ? (_a2 = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a2.text : (_b = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _b.text;
|
|
128212
|
+
}
|
|
128213
|
+
);
|
|
127743
128214
|
}
|
|
127744
128215
|
function getSymbolParentOrFail(symbol) {
|
|
127745
128216
|
var _a2;
|
|
@@ -139359,6 +139830,7 @@ ${lanes.join("\n")}
|
|
|
139359
139830
|
sourceFile,
|
|
139360
139831
|
symbol,
|
|
139361
139832
|
symbolName2,
|
|
139833
|
+
moduleSymbol,
|
|
139362
139834
|
/*isJsxTagName*/
|
|
139363
139835
|
false,
|
|
139364
139836
|
program,
|
|
@@ -139370,7 +139842,6 @@ ${lanes.join("\n")}
|
|
|
139370
139842
|
const fix = getImportFixForSymbol(
|
|
139371
139843
|
sourceFile,
|
|
139372
139844
|
Debug.checkDefined(exportInfo),
|
|
139373
|
-
moduleSymbol,
|
|
139374
139845
|
program,
|
|
139375
139846
|
/*position*/
|
|
139376
139847
|
void 0,
|
|
@@ -139548,13 +140019,19 @@ ${lanes.join("\n")}
|
|
|
139548
140019
|
return result && { ...result, computedWithoutCacheCount };
|
|
139549
140020
|
}
|
|
139550
140021
|
}
|
|
139551
|
-
function getImportCompletionAction(targetSymbol, moduleSymbol, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) {
|
|
140022
|
+
function getImportCompletionAction(targetSymbol, moduleSymbol, exportMapKey, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) {
|
|
139552
140023
|
const compilerOptions = program.getCompilerOptions();
|
|
139553
|
-
|
|
139554
|
-
|
|
140024
|
+
let exportInfos;
|
|
140025
|
+
if (exportMapKey) {
|
|
140026
|
+
exportInfos = getExportInfoMap(sourceFile, host, program, preferences, cancellationToken).get(sourceFile.path, exportMapKey);
|
|
140027
|
+
Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified exportMapKey");
|
|
140028
|
+
} else {
|
|
140029
|
+
exportInfos = pathIsBareSpecifier(stripQuotes(moduleSymbol.name)) ? [getSingleExportInfoForSymbol(targetSymbol, symbolName2, moduleSymbol, program, host)] : getAllExportInfoForSymbol(sourceFile, targetSymbol, symbolName2, moduleSymbol, isJsxTagName, program, host, preferences, cancellationToken);
|
|
140030
|
+
Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified symbol / moduleSymbol");
|
|
140031
|
+
}
|
|
139555
140032
|
const useRequire = shouldUseRequire(sourceFile, program);
|
|
139556
140033
|
const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(getTokenAtPosition(sourceFile, position));
|
|
139557
|
-
const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos,
|
|
140034
|
+
const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences));
|
|
139558
140035
|
return {
|
|
139559
140036
|
moduleSpecifier: fix.moduleSpecifier,
|
|
139560
140037
|
codeAction: codeFixActionToCodeAction(codeActionForFix(
|
|
@@ -139576,23 +140053,22 @@ ${lanes.join("\n")}
|
|
|
139576
140053
|
const includeSymbolNameInDescription = symbolName2 !== symbolToken.text;
|
|
139577
140054
|
return fix && codeFixActionToCodeAction(codeActionForFix({ host, formatContext, preferences }, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences));
|
|
139578
140055
|
}
|
|
139579
|
-
function getImportFixForSymbol(sourceFile, exportInfos,
|
|
139580
|
-
Debug.assert(exportInfos.some((info) => info.moduleSymbol === moduleSymbol || info.symbol.parent === moduleSymbol), "Some exportInfo should match the specified moduleSymbol");
|
|
140056
|
+
function getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) {
|
|
139581
140057
|
const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host);
|
|
139582
140058
|
return getBestFix(getImportFixes(exportInfos, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host);
|
|
139583
140059
|
}
|
|
139584
140060
|
function codeFixActionToCodeAction({ description: description2, changes, commands }) {
|
|
139585
140061
|
return { description: description2, changes, commands };
|
|
139586
140062
|
}
|
|
139587
|
-
function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, preferCapitalized, program, host, preferences, cancellationToken) {
|
|
140063
|
+
function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, moduleSymbol, preferCapitalized, program, host, preferences, cancellationToken) {
|
|
139588
140064
|
const getChecker = createGetChecker(program, host);
|
|
139589
140065
|
return getExportInfoMap(importingFile, host, program, preferences, cancellationToken).search(importingFile.path, preferCapitalized, (name) => name === symbolName2, (info) => {
|
|
139590
|
-
if (skipAlias(info[0].symbol, getChecker(info[0].isFromPackageJson)) === symbol) {
|
|
140066
|
+
if (skipAlias(info[0].symbol, getChecker(info[0].isFromPackageJson)) === symbol && info.some((i) => i.moduleSymbol === moduleSymbol || i.symbol.parent === moduleSymbol)) {
|
|
139591
140067
|
return info;
|
|
139592
140068
|
}
|
|
139593
140069
|
});
|
|
139594
140070
|
}
|
|
139595
|
-
function getSingleExportInfoForSymbol(symbol, moduleSymbol, program, host) {
|
|
140071
|
+
function getSingleExportInfoForSymbol(symbol, symbolName2, moduleSymbol, program, host) {
|
|
139596
140072
|
var _a2, _b;
|
|
139597
140073
|
const compilerOptions = program.getCompilerOptions();
|
|
139598
140074
|
const mainProgramInfo = getInfoWithChecker(
|
|
@@ -139614,7 +140090,7 @@ ${lanes.join("\n")}
|
|
|
139614
140090
|
if (defaultInfo && skipAlias(defaultInfo.symbol, checker) === symbol) {
|
|
139615
140091
|
return { symbol: defaultInfo.symbol, moduleSymbol, moduleFileName: void 0, exportKind: defaultInfo.exportKind, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson };
|
|
139616
140092
|
}
|
|
139617
|
-
const named = checker.tryGetMemberInModuleExportsAndProperties(
|
|
140093
|
+
const named = checker.tryGetMemberInModuleExportsAndProperties(symbolName2, moduleSymbol);
|
|
139618
140094
|
if (named && skipAlias(named, checker) === symbol) {
|
|
139619
140095
|
return { symbol: named, moduleSymbol, moduleFileName: void 0, exportKind: 0 /* Named */, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson };
|
|
139620
140096
|
}
|
|
@@ -147775,6 +148251,7 @@ ${lanes.join("\n")}
|
|
|
147775
148251
|
if (originIsResolvedExport(origin)) {
|
|
147776
148252
|
const resolvedData = {
|
|
147777
148253
|
exportName: origin.exportName,
|
|
148254
|
+
exportMapKey: origin.exportMapKey,
|
|
147778
148255
|
moduleSpecifier: origin.moduleSpecifier,
|
|
147779
148256
|
ambientModuleName,
|
|
147780
148257
|
fileName: origin.fileName,
|
|
@@ -147798,6 +148275,7 @@ ${lanes.join("\n")}
|
|
|
147798
148275
|
const resolvedOrigin = {
|
|
147799
148276
|
kind: 32 /* ResolvedExport */,
|
|
147800
148277
|
exportName: data.exportName,
|
|
148278
|
+
exportMapKey: data.exportMapKey,
|
|
147801
148279
|
moduleSpecifier: data.moduleSpecifier,
|
|
147802
148280
|
symbolName: completionName,
|
|
147803
148281
|
fileName: data.fileName,
|
|
@@ -148176,6 +148654,7 @@ ${lanes.join("\n")}
|
|
|
148176
148654
|
const { moduleSpecifier, codeAction } = ts_codefix_exports.getImportCompletionAction(
|
|
148177
148655
|
targetSymbol,
|
|
148178
148656
|
moduleSymbol,
|
|
148657
|
+
data == null ? void 0 : data.exportMapKey,
|
|
148179
148658
|
sourceFile,
|
|
148180
148659
|
name,
|
|
148181
148660
|
isJsxOpeningTagName,
|
|
@@ -148865,16 +149344,16 @@ ${lanes.join("\n")}
|
|
|
148865
149344
|
if (detailsEntryId && !some(info, (i) => detailsEntryId.source === stripQuotes(i.moduleSymbol.name))) {
|
|
148866
149345
|
return;
|
|
148867
149346
|
}
|
|
148868
|
-
|
|
148869
|
-
if (!
|
|
149347
|
+
info = filter(info, isImportableExportInfo);
|
|
149348
|
+
if (!info.length) {
|
|
148870
149349
|
return;
|
|
148871
149350
|
}
|
|
148872
149351
|
const result = context.tryResolve(info, isFromAmbientModule) || {};
|
|
148873
149352
|
if (result === "failed")
|
|
148874
149353
|
return;
|
|
148875
|
-
let exportInfo2 =
|
|
149354
|
+
let exportInfo2 = info[0], moduleSpecifier;
|
|
148876
149355
|
if (result !== "skipped") {
|
|
148877
|
-
({ exportInfo: exportInfo2 =
|
|
149356
|
+
({ exportInfo: exportInfo2 = info[0], moduleSpecifier } = result);
|
|
148878
149357
|
}
|
|
148879
149358
|
const isDefaultExport = exportInfo2.exportKind === 1 /* Default */;
|
|
148880
149359
|
const symbol = isDefaultExport && getLocalSymbolForExportDefault(exportInfo2.symbol) || exportInfo2.symbol;
|
|
@@ -149038,7 +149517,7 @@ ${lanes.join("\n")}
|
|
|
149038
149517
|
return false;
|
|
149039
149518
|
}
|
|
149040
149519
|
function isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) {
|
|
149041
|
-
return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(
|
|
149520
|
+
return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(contextToken2, position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2)));
|
|
149042
149521
|
}
|
|
149043
149522
|
function tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() {
|
|
149044
149523
|
const typeLiteralNode = tryGetTypeLiteralNode(contextToken);
|