@typescript-deploys/pr-build 5.0.0-pr-52703-9 → 5.0.0-pr-52696-39

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/tsserver.js CHANGED
@@ -2287,7 +2287,7 @@ module.exports = __toCommonJS(server_exports);
2287
2287
 
2288
2288
  // src/compiler/corePublic.ts
2289
2289
  var versionMajorMinor = "5.0";
2290
- var version = `${versionMajorMinor}.0-insiders.20230209`;
2290
+ var version = `${versionMajorMinor}.0-insiders.20230211`;
2291
2291
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2292
2292
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2293
2293
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -9643,6 +9643,7 @@ var Diagnostics = {
9643
9643
  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" }`.'),
9644
9644
  _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."),
9645
9645
  _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."),
9646
+ Decorator_used_before_export_here: diag(1486, 1 /* Error */, "Decorator_used_before_export_here_1486", "Decorator used before 'export' here."),
9646
9647
  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."),
9647
9648
  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."),
9648
9649
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -10999,7 +11000,7 @@ var Diagnostics = {
10999
11000
  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."),
11000
11001
  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."),
11001
11002
  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."),
11002
- Decorators_must_come_after_export_or_export_default_in_JavaScript_files: diag(8038, 1 /* Error */, "Decorators_must_come_after_export_or_export_default_in_JavaScript_files_8038", "Decorators must come after 'export' or 'export default' in JavaScript files."),
11003
+ 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'."),
11003
11004
  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."),
11004
11005
  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."),
11005
11006
  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'."),
@@ -15334,101 +15335,400 @@ function getInternalEmitFlags(node) {
15334
15335
  return emitNode && emitNode.internalFlags || 0;
15335
15336
  }
15336
15337
  function getScriptTargetFeatures() {
15337
- return {
15338
- es2015: {
15339
- Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"],
15340
- RegExp: ["flags", "sticky", "unicode"],
15341
- Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get", " getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"],
15342
- ArrayConstructor: ["from", "of"],
15343
- ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"],
15344
- NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"],
15345
- Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"],
15346
- Map: ["entries", "keys", "values"],
15347
- Set: ["entries", "keys", "values"],
15348
- Promise: emptyArray,
15349
- PromiseConstructor: ["all", "race", "reject", "resolve"],
15350
- Symbol: ["for", "keyFor"],
15351
- WeakMap: ["entries", "keys", "values"],
15352
- WeakSet: ["entries", "keys", "values"],
15353
- Iterator: emptyArray,
15354
- AsyncIterator: emptyArray,
15355
- String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"],
15356
- StringConstructor: ["fromCodePoint", "raw"]
15357
- },
15358
- es2016: {
15359
- Array: ["includes"]
15360
- },
15361
- es2017: {
15362
- Atomics: emptyArray,
15363
- SharedArrayBuffer: emptyArray,
15364
- String: ["padStart", "padEnd"],
15365
- ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"],
15366
- DateTimeFormat: ["formatToParts"]
15367
- },
15368
- es2018: {
15369
- Promise: ["finally"],
15370
- RegExpMatchArray: ["groups"],
15371
- RegExpExecArray: ["groups"],
15372
- RegExp: ["dotAll"],
15373
- Intl: ["PluralRules"],
15374
- AsyncIterable: emptyArray,
15375
- AsyncIterableIterator: emptyArray,
15376
- AsyncGenerator: emptyArray,
15377
- AsyncGeneratorFunction: emptyArray,
15378
- NumberFormat: ["formatToParts"]
15379
- },
15380
- es2019: {
15381
- Array: ["flat", "flatMap"],
15382
- ObjectConstructor: ["fromEntries"],
15383
- String: ["trimStart", "trimEnd", "trimLeft", "trimRight"],
15384
- Symbol: ["description"]
15385
- },
15386
- es2020: {
15387
- BigInt: emptyArray,
15388
- BigInt64Array: emptyArray,
15389
- BigUint64Array: emptyArray,
15390
- PromiseConstructor: ["allSettled"],
15391
- SymbolConstructor: ["matchAll"],
15392
- String: ["matchAll"],
15393
- DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"],
15394
- RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"]
15395
- },
15396
- es2021: {
15397
- PromiseConstructor: ["any"],
15398
- String: ["replaceAll"]
15399
- },
15400
- es2022: {
15401
- Array: ["at"],
15402
- String: ["at"],
15403
- Int8Array: ["at"],
15404
- Uint8Array: ["at"],
15405
- Uint8ClampedArray: ["at"],
15406
- Int16Array: ["at"],
15407
- Uint16Array: ["at"],
15408
- Int32Array: ["at"],
15409
- Uint32Array: ["at"],
15410
- Float32Array: ["at"],
15411
- Float64Array: ["at"],
15412
- BigInt64Array: ["at"],
15413
- BigUint64Array: ["at"],
15414
- ObjectConstructor: ["hasOwn"],
15415
- Error: ["cause"]
15416
- },
15417
- es2023: {
15418
- Array: ["findLastIndex", "findLast"],
15419
- Int8Array: ["findLastIndex", "findLast"],
15420
- Uint8Array: ["findLastIndex", "findLast"],
15421
- Uint8ClampedArray: ["findLastIndex", "findLast"],
15422
- Int16Array: ["findLastIndex", "findLast"],
15423
- Uint16Array: ["findLastIndex", "findLast"],
15424
- Int32Array: ["findLastIndex", "findLast"],
15425
- Uint32Array: ["findLastIndex", "findLast"],
15426
- Float32Array: ["findLastIndex", "findLast"],
15427
- Float64Array: ["findLastIndex", "findLast"],
15428
- BigInt64Array: ["findLastIndex", "findLast"],
15429
- BigUint64Array: ["findLastIndex", "findLast"]
15430
- }
15431
- };
15338
+ return new Map(Object.entries({
15339
+ Array: new Map(Object.entries({
15340
+ es2015: [
15341
+ "find",
15342
+ "findIndex",
15343
+ "fill",
15344
+ "copyWithin",
15345
+ "entries",
15346
+ "keys",
15347
+ "values"
15348
+ ],
15349
+ es2016: [
15350
+ "includes"
15351
+ ],
15352
+ es2019: [
15353
+ "flat",
15354
+ "flatMap"
15355
+ ],
15356
+ es2022: [
15357
+ "at"
15358
+ ],
15359
+ es2023: [
15360
+ "findLastIndex",
15361
+ "findLast"
15362
+ ]
15363
+ })),
15364
+ Iterator: new Map(Object.entries({
15365
+ es2015: emptyArray
15366
+ })),
15367
+ AsyncIterator: new Map(Object.entries({
15368
+ es2015: emptyArray
15369
+ })),
15370
+ Atomics: new Map(Object.entries({
15371
+ es2017: emptyArray
15372
+ })),
15373
+ SharedArrayBuffer: new Map(Object.entries({
15374
+ es2017: emptyArray
15375
+ })),
15376
+ AsyncIterable: new Map(Object.entries({
15377
+ es2018: emptyArray
15378
+ })),
15379
+ AsyncIterableIterator: new Map(Object.entries({
15380
+ es2018: emptyArray
15381
+ })),
15382
+ AsyncGenerator: new Map(Object.entries({
15383
+ es2018: emptyArray
15384
+ })),
15385
+ AsyncGeneratorFunction: new Map(Object.entries({
15386
+ es2018: emptyArray
15387
+ })),
15388
+ RegExp: new Map(Object.entries({
15389
+ es2015: [
15390
+ "flags",
15391
+ "sticky",
15392
+ "unicode"
15393
+ ],
15394
+ es2018: [
15395
+ "dotAll"
15396
+ ]
15397
+ })),
15398
+ Reflect: new Map(Object.entries({
15399
+ es2015: [
15400
+ "apply",
15401
+ "construct",
15402
+ "defineProperty",
15403
+ "deleteProperty",
15404
+ "get",
15405
+ " getOwnPropertyDescriptor",
15406
+ "getPrototypeOf",
15407
+ "has",
15408
+ "isExtensible",
15409
+ "ownKeys",
15410
+ "preventExtensions",
15411
+ "set",
15412
+ "setPrototypeOf"
15413
+ ]
15414
+ })),
15415
+ ArrayConstructor: new Map(Object.entries({
15416
+ es2015: [
15417
+ "from",
15418
+ "of"
15419
+ ]
15420
+ })),
15421
+ ObjectConstructor: new Map(Object.entries({
15422
+ es2015: [
15423
+ "assign",
15424
+ "getOwnPropertySymbols",
15425
+ "keys",
15426
+ "is",
15427
+ "setPrototypeOf"
15428
+ ],
15429
+ es2017: [
15430
+ "values",
15431
+ "entries",
15432
+ "getOwnPropertyDescriptors"
15433
+ ],
15434
+ es2019: [
15435
+ "fromEntries"
15436
+ ],
15437
+ es2022: [
15438
+ "hasOwn"
15439
+ ]
15440
+ })),
15441
+ NumberConstructor: new Map(Object.entries({
15442
+ es2015: [
15443
+ "isFinite",
15444
+ "isInteger",
15445
+ "isNaN",
15446
+ "isSafeInteger",
15447
+ "parseFloat",
15448
+ "parseInt"
15449
+ ]
15450
+ })),
15451
+ Math: new Map(Object.entries({
15452
+ es2015: [
15453
+ "clz32",
15454
+ "imul",
15455
+ "sign",
15456
+ "log10",
15457
+ "log2",
15458
+ "log1p",
15459
+ "expm1",
15460
+ "cosh",
15461
+ "sinh",
15462
+ "tanh",
15463
+ "acosh",
15464
+ "asinh",
15465
+ "atanh",
15466
+ "hypot",
15467
+ "trunc",
15468
+ "fround",
15469
+ "cbrt"
15470
+ ]
15471
+ })),
15472
+ Map: new Map(Object.entries({
15473
+ es2015: [
15474
+ "entries",
15475
+ "keys",
15476
+ "values"
15477
+ ]
15478
+ })),
15479
+ Set: new Map(Object.entries({
15480
+ es2015: [
15481
+ "entries",
15482
+ "keys",
15483
+ "values"
15484
+ ]
15485
+ })),
15486
+ PromiseConstructor: new Map(Object.entries({
15487
+ es2015: [
15488
+ "all",
15489
+ "race",
15490
+ "reject",
15491
+ "resolve"
15492
+ ],
15493
+ es2020: [
15494
+ "allSettled"
15495
+ ],
15496
+ es2021: [
15497
+ "any"
15498
+ ]
15499
+ })),
15500
+ Symbol: new Map(Object.entries({
15501
+ es2015: [
15502
+ "for",
15503
+ "keyFor"
15504
+ ],
15505
+ es2019: [
15506
+ "description"
15507
+ ]
15508
+ })),
15509
+ WeakMap: new Map(Object.entries({
15510
+ es2015: [
15511
+ "entries",
15512
+ "keys",
15513
+ "values"
15514
+ ]
15515
+ })),
15516
+ WeakSet: new Map(Object.entries({
15517
+ es2015: [
15518
+ "entries",
15519
+ "keys",
15520
+ "values"
15521
+ ]
15522
+ })),
15523
+ String: new Map(Object.entries({
15524
+ es2015: [
15525
+ "codePointAt",
15526
+ "includes",
15527
+ "endsWith",
15528
+ "normalize",
15529
+ "repeat",
15530
+ "startsWith",
15531
+ "anchor",
15532
+ "big",
15533
+ "blink",
15534
+ "bold",
15535
+ "fixed",
15536
+ "fontcolor",
15537
+ "fontsize",
15538
+ "italics",
15539
+ "link",
15540
+ "small",
15541
+ "strike",
15542
+ "sub",
15543
+ "sup"
15544
+ ],
15545
+ es2017: [
15546
+ "padStart",
15547
+ "padEnd"
15548
+ ],
15549
+ es2019: [
15550
+ "trimStart",
15551
+ "trimEnd",
15552
+ "trimLeft",
15553
+ "trimRight"
15554
+ ],
15555
+ es2020: [
15556
+ "matchAll"
15557
+ ],
15558
+ es2021: [
15559
+ "replaceAll"
15560
+ ],
15561
+ es2022: [
15562
+ "at"
15563
+ ]
15564
+ })),
15565
+ StringConstructor: new Map(Object.entries({
15566
+ es2015: [
15567
+ "fromCodePoint",
15568
+ "raw"
15569
+ ]
15570
+ })),
15571
+ DateTimeFormat: new Map(Object.entries({
15572
+ es2017: [
15573
+ "formatToParts"
15574
+ ]
15575
+ })),
15576
+ Promise: new Map(Object.entries({
15577
+ es2015: emptyArray,
15578
+ es2018: [
15579
+ "finally"
15580
+ ]
15581
+ })),
15582
+ RegExpMatchArray: new Map(Object.entries({
15583
+ es2018: [
15584
+ "groups"
15585
+ ]
15586
+ })),
15587
+ RegExpExecArray: new Map(Object.entries({
15588
+ es2018: [
15589
+ "groups"
15590
+ ]
15591
+ })),
15592
+ Intl: new Map(Object.entries({
15593
+ es2018: [
15594
+ "PluralRules"
15595
+ ]
15596
+ })),
15597
+ NumberFormat: new Map(Object.entries({
15598
+ es2018: [
15599
+ "formatToParts"
15600
+ ]
15601
+ })),
15602
+ SymbolConstructor: new Map(Object.entries({
15603
+ es2020: [
15604
+ "matchAll"
15605
+ ]
15606
+ })),
15607
+ DataView: new Map(Object.entries({
15608
+ es2020: [
15609
+ "setBigInt64",
15610
+ "setBigUint64",
15611
+ "getBigInt64",
15612
+ "getBigUint64"
15613
+ ]
15614
+ })),
15615
+ BigInt: new Map(Object.entries({
15616
+ es2020: emptyArray
15617
+ })),
15618
+ RelativeTimeFormat: new Map(Object.entries({
15619
+ es2020: [
15620
+ "format",
15621
+ "formatToParts",
15622
+ "resolvedOptions"
15623
+ ]
15624
+ })),
15625
+ Int8Array: new Map(Object.entries({
15626
+ es2022: [
15627
+ "at"
15628
+ ],
15629
+ es2023: [
15630
+ "findLastIndex",
15631
+ "findLast"
15632
+ ]
15633
+ })),
15634
+ Uint8Array: new Map(Object.entries({
15635
+ es2022: [
15636
+ "at"
15637
+ ],
15638
+ es2023: [
15639
+ "findLastIndex",
15640
+ "findLast"
15641
+ ]
15642
+ })),
15643
+ Uint8ClampedArray: new Map(Object.entries({
15644
+ es2022: [
15645
+ "at"
15646
+ ],
15647
+ es2023: [
15648
+ "findLastIndex",
15649
+ "findLast"
15650
+ ]
15651
+ })),
15652
+ Int16Array: new Map(Object.entries({
15653
+ es2022: [
15654
+ "at"
15655
+ ],
15656
+ es2023: [
15657
+ "findLastIndex",
15658
+ "findLast"
15659
+ ]
15660
+ })),
15661
+ Uint16Array: new Map(Object.entries({
15662
+ es2022: [
15663
+ "at"
15664
+ ],
15665
+ es2023: [
15666
+ "findLastIndex",
15667
+ "findLast"
15668
+ ]
15669
+ })),
15670
+ Int32Array: new Map(Object.entries({
15671
+ es2022: [
15672
+ "at"
15673
+ ],
15674
+ es2023: [
15675
+ "findLastIndex",
15676
+ "findLast"
15677
+ ]
15678
+ })),
15679
+ Uint32Array: new Map(Object.entries({
15680
+ es2022: [
15681
+ "at"
15682
+ ],
15683
+ es2023: [
15684
+ "findLastIndex",
15685
+ "findLast"
15686
+ ]
15687
+ })),
15688
+ Float32Array: new Map(Object.entries({
15689
+ es2022: [
15690
+ "at"
15691
+ ],
15692
+ es2023: [
15693
+ "findLastIndex",
15694
+ "findLast"
15695
+ ]
15696
+ })),
15697
+ Float64Array: new Map(Object.entries({
15698
+ es2022: [
15699
+ "at"
15700
+ ],
15701
+ es2023: [
15702
+ "findLastIndex",
15703
+ "findLast"
15704
+ ]
15705
+ })),
15706
+ BigInt64Array: new Map(Object.entries({
15707
+ es2020: emptyArray,
15708
+ es2022: [
15709
+ "at"
15710
+ ],
15711
+ es2023: [
15712
+ "findLastIndex",
15713
+ "findLast"
15714
+ ]
15715
+ })),
15716
+ BigUint64Array: new Map(Object.entries({
15717
+ es2020: emptyArray,
15718
+ es2022: [
15719
+ "at"
15720
+ ],
15721
+ es2023: [
15722
+ "findLastIndex",
15723
+ "findLast"
15724
+ ]
15725
+ })),
15726
+ Error: new Map(Object.entries({
15727
+ es2022: [
15728
+ "cause"
15729
+ ]
15730
+ }))
15731
+ }));
15432
15732
  }
15433
15733
  var GetLiteralTextFlags = /* @__PURE__ */ ((GetLiteralTextFlags2) => {
15434
15734
  GetLiteralTextFlags2[GetLiteralTextFlags2["None"] = 0] = "None";
@@ -26682,14 +26982,114 @@ function createEmitHelperFactory(context) {
26682
26982
  factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name)
26683
26983
  ]);
26684
26984
  }
26985
+ function createESDecorateClassElementAccessGetMethod(elementName) {
26986
+ const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name);
26987
+ return factory2.createPropertyAssignment(
26988
+ "get",
26989
+ factory2.createArrowFunction(
26990
+ /*modifiers*/
26991
+ void 0,
26992
+ /*typeParameters*/
26993
+ void 0,
26994
+ [factory2.createParameterDeclaration(
26995
+ /*modifiers*/
26996
+ void 0,
26997
+ /*dotDotDotToken*/
26998
+ void 0,
26999
+ factory2.createIdentifier("obj")
27000
+ )],
27001
+ /*type*/
27002
+ void 0,
27003
+ /*equalsGreaterThanToken*/
27004
+ void 0,
27005
+ accessor
27006
+ )
27007
+ );
27008
+ }
27009
+ function createESDecorateClassElementAccessSetMethod(elementName) {
27010
+ const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name);
27011
+ return factory2.createPropertyAssignment(
27012
+ "set",
27013
+ factory2.createArrowFunction(
27014
+ /*modifiers*/
27015
+ void 0,
27016
+ /*typeParameters*/
27017
+ void 0,
27018
+ [
27019
+ factory2.createParameterDeclaration(
27020
+ /*modifiers*/
27021
+ void 0,
27022
+ /*dotDotDotToken*/
27023
+ void 0,
27024
+ factory2.createIdentifier("obj")
27025
+ ),
27026
+ factory2.createParameterDeclaration(
27027
+ /*modifiers*/
27028
+ void 0,
27029
+ /*dotDotDotToken*/
27030
+ void 0,
27031
+ factory2.createIdentifier("value")
27032
+ )
27033
+ ],
27034
+ /*type*/
27035
+ void 0,
27036
+ /*equalsGreaterThanToken*/
27037
+ void 0,
27038
+ factory2.createBlock([
27039
+ factory2.createExpressionStatement(
27040
+ factory2.createAssignment(
27041
+ accessor,
27042
+ factory2.createIdentifier("value")
27043
+ )
27044
+ )
27045
+ ])
27046
+ )
27047
+ );
27048
+ }
27049
+ function createESDecorateClassElementAccessHasMethod(elementName) {
27050
+ const propertyName = elementName.computed ? elementName.name : isIdentifier(elementName.name) ? factory2.createStringLiteralFromNode(elementName.name) : elementName.name;
27051
+ return factory2.createPropertyAssignment(
27052
+ "has",
27053
+ factory2.createArrowFunction(
27054
+ /*modifiers*/
27055
+ void 0,
27056
+ /*typeParameters*/
27057
+ void 0,
27058
+ [factory2.createParameterDeclaration(
27059
+ /*modifiers*/
27060
+ void 0,
27061
+ /*dotDotDotToken*/
27062
+ void 0,
27063
+ factory2.createIdentifier("obj")
27064
+ )],
27065
+ /*type*/
27066
+ void 0,
27067
+ /*equalsGreaterThanToken*/
27068
+ void 0,
27069
+ factory2.createBinaryExpression(
27070
+ propertyName,
27071
+ 101 /* InKeyword */,
27072
+ factory2.createIdentifier("obj")
27073
+ )
27074
+ )
27075
+ );
27076
+ }
27077
+ function createESDecorateClassElementAccessObject(name, access) {
27078
+ const properties = [];
27079
+ properties.push(createESDecorateClassElementAccessHasMethod(name));
27080
+ if (access.get)
27081
+ properties.push(createESDecorateClassElementAccessGetMethod(name));
27082
+ if (access.set)
27083
+ properties.push(createESDecorateClassElementAccessSetMethod(name));
27084
+ return factory2.createObjectLiteralExpression(properties);
27085
+ }
26685
27086
  function createESDecorateClassElementContextObject(contextIn) {
26686
27087
  return factory2.createObjectLiteralExpression([
26687
27088
  factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral(contextIn.kind)),
26688
27089
  factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name.computed ? contextIn.name.name : factory2.createStringLiteralFromNode(contextIn.name.name)),
26689
27090
  factory2.createPropertyAssignment(factory2.createIdentifier("static"), contextIn.static ? factory2.createTrue() : factory2.createFalse()),
26690
- factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse())
26691
- // Disabled, pending resolution of https://github.com/tc39/proposal-decorators/issues/494
26692
- // factory.createPropertyAssignment(factory.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access))
27091
+ factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()),
27092
+ factory2.createPropertyAssignment(factory2.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access))
26693
27093
  ]);
26694
27094
  }
26695
27095
  function createESDecorateContextObject(contextIn) {
@@ -33143,6 +33543,12 @@ var Parser;
33143
33543
  case 114 /* VoidKeyword */:
33144
33544
  return parseVoidExpression();
33145
33545
  case 29 /* LessThanToken */:
33546
+ if (languageVariant === 1 /* JSX */) {
33547
+ return parseJsxElementOrSelfClosingElementOrFragment(
33548
+ /*inExpressionContext*/
33549
+ true
33550
+ );
33551
+ }
33146
33552
  return parseTypeAssertion();
33147
33553
  case 133 /* AwaitKeyword */:
33148
33554
  if (isAwaitExpression2()) {
@@ -33514,6 +33920,7 @@ var Parser;
33514
33920
  return finishNode(factory2.createJsxJsxClosingFragment(), pos);
33515
33921
  }
33516
33922
  function parseTypeAssertion() {
33923
+ Debug.assert(scriptKind === 3 /* TS */, "Type assertions should never be parsed outside of TS; they should either be comparisons or JSX.");
33517
33924
  const pos = getNodePos();
33518
33925
  parseExpected(29 /* LessThanToken */);
33519
33926
  const type = parseType();
@@ -34864,17 +35271,25 @@ var Parser;
34864
35271
  function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) {
34865
35272
  const pos = getNodePos();
34866
35273
  let list;
34867
- let modifier, hasSeenStaticModifier = false;
35274
+ let decorator, modifier, hasSeenStaticModifier = false, hasLeadingModifier = false, hasTrailingDecorator = false;
35275
+ if (allowDecorators && token() === 59 /* AtToken */) {
35276
+ while (decorator = tryParseDecorator()) {
35277
+ list = append(list, decorator);
35278
+ }
35279
+ }
34868
35280
  while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) {
34869
35281
  if (modifier.kind === 124 /* StaticKeyword */)
34870
35282
  hasSeenStaticModifier = true;
34871
35283
  list = append(list, modifier);
35284
+ hasLeadingModifier = true;
34872
35285
  }
34873
- if (allowDecorators && token() === 59 /* AtToken */) {
34874
- let decorator;
35286
+ if (hasLeadingModifier && allowDecorators && token() === 59 /* AtToken */) {
34875
35287
  while (decorator = tryParseDecorator()) {
34876
35288
  list = append(list, decorator);
35289
+ hasTrailingDecorator = true;
34877
35290
  }
35291
+ }
35292
+ if (hasTrailingDecorator) {
34878
35293
  while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) {
34879
35294
  if (modifier.kind === 124 /* StaticKeyword */)
34880
35295
  hasSeenStaticModifier = true;
@@ -47456,6 +47871,7 @@ function createTypeChecker(host) {
47456
47871
  let flowTypeCache;
47457
47872
  const contextualTypeNodes = [];
47458
47873
  const contextualTypes = [];
47874
+ const contextualIsCache = [];
47459
47875
  let contextualTypeCount = 0;
47460
47876
  const inferenceContextNodes = [];
47461
47877
  const inferenceContexts = [];
@@ -54626,6 +55042,8 @@ function createTypeChecker(host) {
54626
55042
  return !!target.baseTypesResolved;
54627
55043
  case 8 /* WriteType */:
54628
55044
  return !!getSymbolLinks(target).writeType;
55045
+ case 9 /* ParameterInitializerContainsUndefined */:
55046
+ return getNodeLinks(target).parameterInitializerContainsUndefined !== void 0;
54629
55047
  }
54630
55048
  return Debug.assertNever(propertyName);
54631
55049
  }
@@ -59892,7 +60310,7 @@ function createTypeChecker(host) {
59892
60310
  }
59893
60311
  }
59894
60312
  function removeStringLiteralsMatchedByTemplateLiterals(types) {
59895
- const templates = filter(types, isPatternLiteralType);
60313
+ const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
59896
60314
  if (templates.length) {
59897
60315
  let i = types.length;
59898
60316
  while (i > 0) {
@@ -62417,7 +62835,12 @@ function createTypeChecker(host) {
62417
62835
  }
62418
62836
  }
62419
62837
  function checkExpressionForMutableLocationWithContextualType(next, sourcePropType) {
62420
- pushContextualType(next, sourcePropType);
62838
+ pushContextualType(
62839
+ next,
62840
+ sourcePropType,
62841
+ /*isCache*/
62842
+ false
62843
+ );
62421
62844
  const result = checkExpressionForMutableLocation(next, 1 /* Contextual */);
62422
62845
  popContextualType();
62423
62846
  return result;
@@ -62725,7 +63148,12 @@ function createTypeChecker(host) {
62725
63148
  if (isTupleLikeType(source)) {
62726
63149
  return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer);
62727
63150
  }
62728
- pushContextualType(node, target);
63151
+ pushContextualType(
63152
+ node,
63153
+ target,
63154
+ /*isCache*/
63155
+ false
63156
+ );
62729
63157
  const tupleizedType = checkArrayLiteral(
62730
63158
  node,
62731
63159
  1 /* Contextual */,
@@ -65950,14 +66378,6 @@ function createTypeChecker(host) {
65950
66378
  const key = `B${getTypeId(type)}`;
65951
66379
  return (_a2 = getCachedType(key)) != null ? _a2 : setCachedType(key, mapType(type, getBaseTypeOfLiteralType));
65952
66380
  }
65953
- function getBaseTypeOfLiteralTypeForComparison(type) {
65954
- return type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) : type.flags & 1048576 /* Union */ ? getBaseTypeOfLiteralTypeUnionForComparison(type) : type;
65955
- }
65956
- function getBaseTypeOfLiteralTypeUnionForComparison(type) {
65957
- var _a2;
65958
- const key = `BC${getTypeId(type)}`;
65959
- return (_a2 = getCachedType(key)) != null ? _a2 : setCachedType(key, mapType(type, getBaseTypeOfLiteralTypeForComparison));
65960
- }
65961
66381
  function getWidenedLiteralType(type) {
65962
66382
  return type.flags & 1024 /* EnumLiteral */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLiteralType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type;
65963
66383
  }
@@ -69456,15 +69876,25 @@ function createTypeChecker(host) {
69456
69876
  function isConstVariable(symbol) {
69457
69877
  return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0;
69458
69878
  }
69459
- function removeOptionalityFromDeclaredType(declaredType, declaration) {
69460
- if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) {
69461
- const annotationIncludesUndefined = strictNullChecks && declaration.kind === 166 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */);
69462
- popTypeResolution();
69463
- return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;
69464
- } else {
69465
- reportCircularityError(declaration.symbol);
69466
- return declaredType;
69879
+ function parameterInitializerContainsUndefined(declaration) {
69880
+ const links = getNodeLinks(declaration);
69881
+ if (links.parameterInitializerContainsUndefined === void 0) {
69882
+ if (!pushTypeResolution(declaration, 9 /* ParameterInitializerContainsUndefined */)) {
69883
+ reportCircularityError(declaration.symbol);
69884
+ return true;
69885
+ }
69886
+ const containsUndefined = !!(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */);
69887
+ if (!popTypeResolution()) {
69888
+ reportCircularityError(declaration.symbol);
69889
+ return true;
69890
+ }
69891
+ links.parameterInitializerContainsUndefined = containsUndefined;
69467
69892
  }
69893
+ return links.parameterInitializerContainsUndefined;
69894
+ }
69895
+ function removeOptionalityFromDeclaredType(declaredType, declaration) {
69896
+ const removeUndefined = strictNullChecks && declaration.kind === 166 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !parameterInitializerContainsUndefined(declaration);
69897
+ return removeUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;
69468
69898
  }
69469
69899
  function isConstraintPosition(type, node) {
69470
69900
  const parent2 = node.parent;
@@ -70782,11 +71212,13 @@ function createTypeChecker(host) {
70782
71212
  if (node.flags & 33554432 /* InWithStatement */) {
70783
71213
  return void 0;
70784
71214
  }
70785
- const index = findContextualNode(node);
71215
+ const index = findContextualNode(
71216
+ node,
71217
+ /*includeCaches*/
71218
+ !contextFlags
71219
+ );
70786
71220
  if (index >= 0) {
70787
- const cached = contextualTypes[index];
70788
- if (cached || !contextFlags)
70789
- return cached;
71221
+ return contextualTypes[index];
70790
71222
  }
70791
71223
  const { parent: parent2 } = node;
70792
71224
  switch (parent2.kind) {
@@ -70857,17 +71289,30 @@ function createTypeChecker(host) {
70857
71289
  }
70858
71290
  return void 0;
70859
71291
  }
70860
- function pushContextualType(node, type) {
71292
+ function pushCachedContextualType(node) {
71293
+ pushContextualType(
71294
+ node,
71295
+ getContextualType2(
71296
+ node,
71297
+ /*contextFlags*/
71298
+ void 0
71299
+ ),
71300
+ /*isCache*/
71301
+ true
71302
+ );
71303
+ }
71304
+ function pushContextualType(node, type, isCache) {
70861
71305
  contextualTypeNodes[contextualTypeCount] = node;
70862
71306
  contextualTypes[contextualTypeCount] = type;
71307
+ contextualIsCache[contextualTypeCount] = isCache;
70863
71308
  contextualTypeCount++;
70864
71309
  }
70865
71310
  function popContextualType() {
70866
71311
  contextualTypeCount--;
70867
71312
  }
70868
- function findContextualNode(node) {
71313
+ function findContextualNode(node, includeCaches) {
70869
71314
  for (let i = contextualTypeCount - 1; i >= 0; i--) {
70870
- if (node === contextualTypeNodes[i]) {
71315
+ if (node === contextualTypeNodes[i] && (includeCaches || !contextualIsCache[i])) {
70871
71316
  return i;
70872
71317
  }
70873
71318
  }
@@ -70890,7 +71335,11 @@ function createTypeChecker(host) {
70890
71335
  }
70891
71336
  function getContextualJsxElementAttributesType(node, contextFlags) {
70892
71337
  if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) {
70893
- const index = findContextualNode(node.parent);
71338
+ const index = findContextualNode(
71339
+ node.parent,
71340
+ /*includeCaches*/
71341
+ !contextFlags
71342
+ );
70894
71343
  if (index >= 0) {
70895
71344
  return contextualTypes[index];
70896
71345
  }
@@ -71161,11 +71610,7 @@ function createTypeChecker(host) {
71161
71610
  const elementCount = elements.length;
71162
71611
  const elementTypes = [];
71163
71612
  const elementFlags = [];
71164
- pushContextualType(node, getContextualType2(
71165
- node,
71166
- /*contextFlags*/
71167
- void 0
71168
- ));
71613
+ pushCachedContextualType(node);
71169
71614
  const inDestructuringPattern = isAssignmentTarget(node);
71170
71615
  const inConstContext = isConstContext(node);
71171
71616
  const contextualType = getApparentTypeOfContextualType(
@@ -71328,11 +71773,7 @@ function createTypeChecker(host) {
71328
71773
  let propertiesTable = createSymbolTable();
71329
71774
  let propertiesArray = [];
71330
71775
  let spread = emptyObjectType;
71331
- pushContextualType(node, getContextualType2(
71332
- node,
71333
- /*contextFlags*/
71334
- void 0
71335
- ));
71776
+ pushCachedContextualType(node);
71336
71777
  const contextualType = getApparentTypeOfContextualType(
71337
71778
  node,
71338
71779
  /*contextFlags*/
@@ -72672,26 +73113,22 @@ function createTypeChecker(host) {
72672
73113
  function getSuggestedLibForNonExistentName(name) {
72673
73114
  const missingName = diagnosticName(name);
72674
73115
  const allFeatures = getScriptTargetFeatures();
72675
- const libTargets = getOwnKeys(allFeatures);
72676
- for (const libTarget of libTargets) {
72677
- const containingTypes = getOwnKeys(allFeatures[libTarget]);
72678
- if (containingTypes !== void 0 && contains(containingTypes, missingName)) {
72679
- return libTarget;
72680
- }
72681
- }
73116
+ const typeFeatures = allFeatures.get(missingName);
73117
+ return typeFeatures && firstIterator(typeFeatures.keys());
72682
73118
  }
72683
73119
  function getSuggestedLibForNonExistentProperty(missingProperty, containingType) {
72684
73120
  const container = getApparentType(containingType).symbol;
72685
73121
  if (!container) {
72686
73122
  return void 0;
72687
73123
  }
73124
+ const containingTypeName = symbolName(container);
72688
73125
  const allFeatures = getScriptTargetFeatures();
72689
- const libTargets = getOwnKeys(allFeatures);
72690
- for (const libTarget of libTargets) {
72691
- const featuresOfLib = allFeatures[libTarget];
72692
- const featuresOfContainingType = featuresOfLib[symbolName(container)];
72693
- if (featuresOfContainingType !== void 0 && contains(featuresOfContainingType, missingProperty)) {
72694
- return libTarget;
73126
+ const typeFeatures = allFeatures.get(containingTypeName);
73127
+ if (typeFeatures) {
73128
+ for (const [libTarget, featuresOfType] of typeFeatures) {
73129
+ if (contains(featuresOfType, missingProperty)) {
73130
+ return libTarget;
73131
+ }
72695
73132
  }
72696
73133
  }
72697
73134
  }
@@ -76995,8 +77432,8 @@ function createTypeChecker(host) {
76995
77432
  case 32 /* LessThanEqualsToken */:
76996
77433
  case 33 /* GreaterThanEqualsToken */:
76997
77434
  if (checkForDisallowedESSymbolOperand(operator)) {
76998
- leftType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(leftType, left));
76999
- rightType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(rightType, right));
77435
+ leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left));
77436
+ rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right));
77000
77437
  reportOperatorErrorUnless((left2, right2) => {
77001
77438
  if (isTypeAny(left2) || isTypeAny(right2)) {
77002
77439
  return true;
@@ -77347,14 +77784,19 @@ function createTypeChecker(host) {
77347
77784
  return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */));
77348
77785
  }
77349
77786
  function getContextNode2(node) {
77350
- if (node.kind === 289 /* JsxAttributes */ && !isJsxSelfClosingElement(node.parent)) {
77787
+ if (isJsxAttributes(node) && !isJsxSelfClosingElement(node.parent)) {
77351
77788
  return node.parent.parent;
77352
77789
  }
77353
77790
  return node;
77354
77791
  }
77355
77792
  function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) {
77356
77793
  const contextNode = getContextNode2(node);
77357
- pushContextualType(contextNode, contextualType);
77794
+ pushContextualType(
77795
+ contextNode,
77796
+ contextualType,
77797
+ /*isCache*/
77798
+ false
77799
+ );
77358
77800
  pushInferenceContext(contextNode, inferenceContext);
77359
77801
  const type = checkExpression(node, checkMode | 1 /* Contextual */ | (inferenceContext ? 2 /* Inferential */ : 0));
77360
77802
  if (inferenceContext && inferenceContext.intraExpressionInferenceSites) {
@@ -77695,7 +78137,12 @@ function createTypeChecker(host) {
77695
78137
  if (links.contextFreeType) {
77696
78138
  return links.contextFreeType;
77697
78139
  }
77698
- pushContextualType(node, anyType);
78140
+ pushContextualType(
78141
+ node,
78142
+ anyType,
78143
+ /*isCache*/
78144
+ false
78145
+ );
77699
78146
  const type = links.contextFreeType = checkExpression(node, 4 /* SkipContextSensitive */);
77700
78147
  popContextualType();
77701
78148
  return type;
@@ -85149,6 +85596,7 @@ function createTypeChecker(host) {
85149
85596
  let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator;
85150
85597
  let flags = 0 /* None */;
85151
85598
  let sawExportBeforeDecorators = false;
85599
+ let hasLeadingDecorators = false;
85152
85600
  for (const modifier of node.modifiers) {
85153
85601
  if (isDecorator(modifier)) {
85154
85602
  if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) {
@@ -85166,8 +85614,22 @@ function createTypeChecker(host) {
85166
85614
  if (flags & ~(1025 /* ExportDefault */ | 131072 /* Decorator */)) {
85167
85615
  return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here);
85168
85616
  }
85617
+ if (hasLeadingDecorators && flags & 126975 /* Modifier */) {
85618
+ Debug.assertIsDefined(firstDecorator);
85619
+ const sourceFile = getSourceFileOfNode(modifier);
85620
+ if (!hasParseDiagnostics(sourceFile)) {
85621
+ addRelatedInfo(
85622
+ error(modifier, Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),
85623
+ createDiagnosticForNode(firstDecorator, Diagnostics.Decorator_used_before_export_here)
85624
+ );
85625
+ return true;
85626
+ }
85627
+ return false;
85628
+ }
85169
85629
  flags |= 131072 /* Decorator */;
85170
- if (flags & 1 /* Export */) {
85630
+ if (!(flags & 126975 /* Modifier */)) {
85631
+ hasLeadingDecorators = true;
85632
+ } else if (flags & 1 /* Export */) {
85171
85633
  sawExportBeforeDecorators = true;
85172
85634
  }
85173
85635
  firstDecorator != null ? firstDecorator : firstDecorator = modifier;
@@ -118330,11 +118792,19 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
118330
118792
  diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
118331
118793
  } else if (isClassDeclaration(parent2)) {
118332
118794
  const exportIndex = findIndex(parent2.modifiers, isExportModifier);
118333
- const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier);
118334
- if (exportIndex >= 0 && decoratorIndex < exportIndex) {
118335
- diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_must_come_after_export_or_export_default_in_JavaScript_files));
118336
- } else if (defaultIndex >= 0 && decoratorIndex < defaultIndex) {
118337
- diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
118795
+ if (exportIndex >= 0) {
118796
+ const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier);
118797
+ if (decoratorIndex > exportIndex && defaultIndex >= 0 && decoratorIndex < defaultIndex) {
118798
+ diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
118799
+ } else if (exportIndex >= 0 && decoratorIndex < exportIndex) {
118800
+ const trailingDecoratorIndex = findIndex(parent2.modifiers, isDecorator, exportIndex);
118801
+ if (trailingDecoratorIndex >= 0) {
118802
+ diagnostics.push(addRelatedInfo(
118803
+ createDiagnosticForNode2(parent2.modifiers[trailingDecoratorIndex], Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),
118804
+ createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorator_used_before_export_here)
118805
+ ));
118806
+ }
118807
+ }
118338
118808
  }
118339
118809
  }
118340
118810
  }
@@ -129440,10 +129910,13 @@ function needsNameFromDeclaration(symbol) {
129440
129910
  return !(symbol.flags & 33554432 /* Transient */) && (symbol.escapedName === "export=" /* ExportEquals */ || symbol.escapedName === "default" /* Default */);
129441
129911
  }
129442
129912
  function getDefaultLikeExportNameFromDeclaration(symbol) {
129443
- return firstDefined(symbol.declarations, (d) => {
129444
- var _a2;
129445
- return isExportAssignment(d) ? (_a2 = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a2.text : void 0;
129446
- });
129913
+ return firstDefined(
129914
+ symbol.declarations,
129915
+ (d) => {
129916
+ var _a2, _b;
129917
+ return isExportAssignment(d) ? (_a2 = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a2.text : (_b = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _b.text;
129918
+ }
129919
+ );
129447
129920
  }
129448
129921
  function getSymbolParentOrFail(symbol) {
129449
129922
  var _a2;
@@ -140802,6 +141275,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre
140802
141275
  sourceFile,
140803
141276
  symbol,
140804
141277
  symbolName2,
141278
+ moduleSymbol,
140805
141279
  /*isJsxTagName*/
140806
141280
  false,
140807
141281
  program,
@@ -140813,7 +141287,6 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre
140813
141287
  const fix = getImportFixForSymbol(
140814
141288
  sourceFile,
140815
141289
  Debug.checkDefined(exportInfo),
140816
- moduleSymbol,
140817
141290
  program,
140818
141291
  /*position*/
140819
141292
  void 0,
@@ -140991,13 +141464,19 @@ function createImportSpecifierResolver(importingFile, program, host, preferences
140991
141464
  return result && { ...result, computedWithoutCacheCount };
140992
141465
  }
140993
141466
  }
140994
- function getImportCompletionAction(targetSymbol, moduleSymbol, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) {
141467
+ function getImportCompletionAction(targetSymbol, moduleSymbol, exportMapKey, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) {
140995
141468
  const compilerOptions = program.getCompilerOptions();
140996
- const exportInfos = pathIsBareSpecifier(stripQuotes(moduleSymbol.name)) ? [getSingleExportInfoForSymbol(targetSymbol, moduleSymbol, program, host)] : getAllExportInfoForSymbol(sourceFile, targetSymbol, symbolName2, isJsxTagName, program, host, preferences, cancellationToken);
140997
- Debug.assertIsDefined(exportInfos);
141469
+ let exportInfos;
141470
+ if (exportMapKey) {
141471
+ exportInfos = getExportInfoMap(sourceFile, host, program, preferences, cancellationToken).get(sourceFile.path, exportMapKey);
141472
+ Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified exportMapKey");
141473
+ } else {
141474
+ exportInfos = pathIsBareSpecifier(stripQuotes(moduleSymbol.name)) ? [getSingleExportInfoForSymbol(targetSymbol, symbolName2, moduleSymbol, program, host)] : getAllExportInfoForSymbol(sourceFile, targetSymbol, symbolName2, moduleSymbol, isJsxTagName, program, host, preferences, cancellationToken);
141475
+ Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified symbol / moduleSymbol");
141476
+ }
140998
141477
  const useRequire = shouldUseRequire(sourceFile, program);
140999
141478
  const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(getTokenAtPosition(sourceFile, position));
141000
- const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences));
141479
+ const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences));
141001
141480
  return {
141002
141481
  moduleSpecifier: fix.moduleSpecifier,
141003
141482
  codeAction: codeFixActionToCodeAction(codeActionForFix(
@@ -141019,23 +141498,22 @@ function getPromoteTypeOnlyCompletionAction(sourceFile, symbolToken, program, ho
141019
141498
  const includeSymbolNameInDescription = symbolName2 !== symbolToken.text;
141020
141499
  return fix && codeFixActionToCodeAction(codeActionForFix({ host, formatContext, preferences }, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences));
141021
141500
  }
141022
- function getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) {
141023
- Debug.assert(exportInfos.some((info) => info.moduleSymbol === moduleSymbol || info.symbol.parent === moduleSymbol), "Some exportInfo should match the specified moduleSymbol");
141501
+ function getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) {
141024
141502
  const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host);
141025
141503
  return getBestFix(getImportFixes(exportInfos, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host);
141026
141504
  }
141027
141505
  function codeFixActionToCodeAction({ description: description2, changes, commands }) {
141028
141506
  return { description: description2, changes, commands };
141029
141507
  }
141030
- function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, preferCapitalized, program, host, preferences, cancellationToken) {
141508
+ function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, moduleSymbol, preferCapitalized, program, host, preferences, cancellationToken) {
141031
141509
  const getChecker = createGetChecker(program, host);
141032
141510
  return getExportInfoMap(importingFile, host, program, preferences, cancellationToken).search(importingFile.path, preferCapitalized, (name) => name === symbolName2, (info) => {
141033
- if (skipAlias(info[0].symbol, getChecker(info[0].isFromPackageJson)) === symbol) {
141511
+ if (skipAlias(info[0].symbol, getChecker(info[0].isFromPackageJson)) === symbol && info.some((i) => i.moduleSymbol === moduleSymbol || i.symbol.parent === moduleSymbol)) {
141034
141512
  return info;
141035
141513
  }
141036
141514
  });
141037
141515
  }
141038
- function getSingleExportInfoForSymbol(symbol, moduleSymbol, program, host) {
141516
+ function getSingleExportInfoForSymbol(symbol, symbolName2, moduleSymbol, program, host) {
141039
141517
  var _a2, _b;
141040
141518
  const compilerOptions = program.getCompilerOptions();
141041
141519
  const mainProgramInfo = getInfoWithChecker(
@@ -141057,7 +141535,7 @@ function getSingleExportInfoForSymbol(symbol, moduleSymbol, program, host) {
141057
141535
  if (defaultInfo && skipAlias(defaultInfo.symbol, checker) === symbol) {
141058
141536
  return { symbol: defaultInfo.symbol, moduleSymbol, moduleFileName: void 0, exportKind: defaultInfo.exportKind, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson };
141059
141537
  }
141060
- const named = checker.tryGetMemberInModuleExportsAndProperties(symbol.name, moduleSymbol);
141538
+ const named = checker.tryGetMemberInModuleExportsAndProperties(symbolName2, moduleSymbol);
141061
141539
  if (named && skipAlias(named, checker) === symbol) {
141062
141540
  return { symbol: named, moduleSymbol, moduleFileName: void 0, exportKind: 0 /* Named */, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson };
141063
141541
  }
@@ -148716,6 +149194,7 @@ function originToCompletionEntryData(origin) {
148716
149194
  if (originIsResolvedExport(origin)) {
148717
149195
  const resolvedData = {
148718
149196
  exportName: origin.exportName,
149197
+ exportMapKey: origin.exportMapKey,
148719
149198
  moduleSpecifier: origin.moduleSpecifier,
148720
149199
  ambientModuleName,
148721
149200
  fileName: origin.fileName,
@@ -148739,6 +149218,7 @@ function completionEntryDataToSymbolOriginInfo(data, completionName, moduleSymbo
148739
149218
  const resolvedOrigin = {
148740
149219
  kind: 32 /* ResolvedExport */,
148741
149220
  exportName: data.exportName,
149221
+ exportMapKey: data.exportMapKey,
148742
149222
  moduleSpecifier: data.moduleSpecifier,
148743
149223
  symbolName: completionName,
148744
149224
  fileName: data.fileName,
@@ -149117,6 +149597,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
149117
149597
  const { moduleSpecifier, codeAction } = ts_codefix_exports.getImportCompletionAction(
149118
149598
  targetSymbol,
149119
149599
  moduleSymbol,
149600
+ data == null ? void 0 : data.exportMapKey,
149120
149601
  sourceFile,
149121
149602
  name,
149122
149603
  isJsxOpeningTagName,
@@ -149815,16 +150296,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
149815
150296
  if (detailsEntryId && !some(info, (i) => detailsEntryId.source === stripQuotes(i.moduleSymbol.name))) {
149816
150297
  return;
149817
150298
  }
149818
- const firstImportableExportInfo = find(info, isImportableExportInfo);
149819
- if (!firstImportableExportInfo) {
150299
+ info = filter(info, isImportableExportInfo);
150300
+ if (!info.length) {
149820
150301
  return;
149821
150302
  }
149822
150303
  const result = context.tryResolve(info, isFromAmbientModule) || {};
149823
150304
  if (result === "failed")
149824
150305
  return;
149825
- let exportInfo2 = firstImportableExportInfo, moduleSpecifier;
150306
+ let exportInfo2 = info[0], moduleSpecifier;
149826
150307
  if (result !== "skipped") {
149827
- ({ exportInfo: exportInfo2 = firstImportableExportInfo, moduleSpecifier } = result);
150308
+ ({ exportInfo: exportInfo2 = info[0], moduleSpecifier } = result);
149828
150309
  }
149829
150310
  const isDefaultExport = exportInfo2.exportKind === 1 /* Default */;
149830
150311
  const symbol = isDefaultExport && getLocalSymbolForExportDefault(exportInfo2.symbol) || exportInfo2.symbol;
@@ -149988,7 +150469,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
149988
150469
  return false;
149989
150470
  }
149990
150471
  function isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) {
149991
- return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(createTextRangeFromSpan(createTextSpanFromNode(contextToken2)), position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2)));
150472
+ return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(contextToken2, position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2)));
149992
150473
  }
149993
150474
  function tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() {
149994
150475
  const typeLiteralNode = tryGetTypeLiteralNode(contextToken);