@typescript-deploys/pr-build 5.0.0-pr-52667-13 → 5.0.0-pr-52710-9

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.20230208`;
2290
+ var version = `${versionMajorMinor}.0-insiders.20230210`;
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) {
@@ -31007,8 +31407,13 @@ var Parser;
31007
31407
  return tokenIsIdentifierOrKeyword(token()) || token() === 18 /* OpenBraceToken */;
31008
31408
  case 14 /* JsxChildren */:
31009
31409
  return true;
31410
+ case 25 /* StandaloneJSDoc */:
31411
+ return true;
31412
+ case 26 /* Count */:
31413
+ return Debug.fail("ParsingContext.Count used as a context");
31414
+ default:
31415
+ Debug.assertNever(parsingContext2, "Non-exhaustive case in 'isListElement'.");
31010
31416
  }
31011
- return Debug.fail("Non-exhaustive case in 'isListElement'.");
31012
31417
  }
31013
31418
  function isValidHeritageClauseObjectLiteral() {
31014
31419
  Debug.assert(token() === 18 /* OpenBraceToken */);
@@ -31102,7 +31507,8 @@ var Parser;
31102
31507
  return false;
31103
31508
  }
31104
31509
  function isInSomeParsingContext() {
31105
- for (let kind = 0; kind < 25 /* Count */; kind++) {
31510
+ Debug.assert(parsingContext, "Missing parsing context");
31511
+ for (let kind = 0; kind < 26 /* Count */; kind++) {
31106
31512
  if (parsingContext & 1 << kind) {
31107
31513
  if (isListElement2(
31108
31514
  kind,
@@ -31181,6 +31587,7 @@ var Parser;
31181
31587
  case 8 /* VariableDeclarations */:
31182
31588
  case 17 /* JSDocParameters */:
31183
31589
  case 16 /* Parameters */:
31590
+ case 25 /* StandaloneJSDoc */:
31184
31591
  return true;
31185
31592
  }
31186
31593
  return false;
@@ -31361,7 +31768,9 @@ var Parser;
31361
31768
  return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
31362
31769
  case 24 /* AssertEntries */:
31363
31770
  return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
31364
- case 25 /* Count */:
31771
+ case 25 /* StandaloneJSDoc */:
31772
+ return;
31773
+ case 26 /* Count */:
31365
31774
  return Debug.fail("ParsingContext.Count used as a context");
31366
31775
  default:
31367
31776
  Debug.assertNever(context);
@@ -33143,7 +33552,7 @@ var Parser;
33143
33552
  case 114 /* VoidKeyword */:
33144
33553
  return parseVoidExpression();
33145
33554
  case 29 /* LessThanToken */:
33146
- if (languageVariant === 1 /* JSX */ && token() === 29 /* LessThanToken */ && lookAhead(nextTokenIsIdentifierOrKeywordOrGreaterThan)) {
33555
+ if (languageVariant === 1 /* JSX */) {
33147
33556
  return parseJsxElementOrSelfClosingElementOrFragment(
33148
33557
  /*inExpressionContext*/
33149
33558
  true
@@ -33520,7 +33929,7 @@ var Parser;
33520
33929
  return finishNode(factory2.createJsxJsxClosingFragment(), pos);
33521
33930
  }
33522
33931
  function parseTypeAssertion() {
33523
- Debug.assert(scriptKind === 3 /* TS */ || scriptKind === 4 /* TSX */, "Type assertions should never be parsed outside of TS/TSX; they should either be comparisons or JSX.");
33932
+ Debug.assert(scriptKind === 3 /* TS */, "Type assertions should never be parsed outside of TS; they should either be comparisons or JSX.");
33524
33933
  const pos = getNodePos();
33525
33934
  parseExpected(29 /* LessThanToken */);
33526
33935
  const type = parseType();
@@ -34871,17 +35280,25 @@ var Parser;
34871
35280
  function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) {
34872
35281
  const pos = getNodePos();
34873
35282
  let list;
34874
- let modifier, hasSeenStaticModifier = false;
35283
+ let decorator, modifier, hasSeenStaticModifier = false, hasLeadingModifier = false, hasTrailingDecorator = false;
35284
+ if (allowDecorators && token() === 59 /* AtToken */) {
35285
+ while (decorator = tryParseDecorator()) {
35286
+ list = append(list, decorator);
35287
+ }
35288
+ }
34875
35289
  while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) {
34876
35290
  if (modifier.kind === 124 /* StaticKeyword */)
34877
35291
  hasSeenStaticModifier = true;
34878
35292
  list = append(list, modifier);
35293
+ hasLeadingModifier = true;
34879
35294
  }
34880
- if (allowDecorators && token() === 59 /* AtToken */) {
34881
- let decorator;
35295
+ if (hasLeadingModifier && allowDecorators && token() === 59 /* AtToken */) {
34882
35296
  while (decorator = tryParseDecorator()) {
34883
35297
  list = append(list, decorator);
35298
+ hasTrailingDecorator = true;
34884
35299
  }
35300
+ }
35301
+ if (hasTrailingDecorator) {
34885
35302
  while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) {
34886
35303
  if (modifier.kind === 124 /* StaticKeyword */)
34887
35304
  hasSeenStaticModifier = true;
@@ -35453,7 +35870,8 @@ var Parser;
35453
35870
  ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
35454
35871
  ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
35455
35872
  ParsingContext2[ParsingContext2["AssertEntries"] = 24] = "AssertEntries";
35456
- ParsingContext2[ParsingContext2["Count"] = 25] = "Count";
35873
+ ParsingContext2[ParsingContext2["StandaloneJSDoc"] = 25] = "StandaloneJSDoc";
35874
+ ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
35457
35875
  })(ParsingContext || (ParsingContext = {}));
35458
35876
  let Tristate;
35459
35877
  ((Tristate2) => {
@@ -35575,6 +35993,13 @@ var Parser;
35575
35993
  PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter";
35576
35994
  })(PropertyLikeParse || (PropertyLikeParse = {}));
35577
35995
  function parseJSDocCommentWorker(start2 = 0, length2) {
35996
+ const saveParsingContext = parsingContext;
35997
+ parsingContext |= 1 << 25 /* StandaloneJSDoc */;
35998
+ const jsdoc = parseJSDocCommentWorkerWorker(start2, length2);
35999
+ parsingContext = saveParsingContext;
36000
+ return jsdoc;
36001
+ }
36002
+ function parseJSDocCommentWorkerWorker(start2, length2) {
35578
36003
  const content = sourceText;
35579
36004
  const end = length2 === void 0 ? content.length : start2 + length2;
35580
36005
  length2 = end - start2;
@@ -59899,7 +60324,7 @@ function createTypeChecker(host) {
59899
60324
  }
59900
60325
  }
59901
60326
  function removeStringLiteralsMatchedByTemplateLiterals(types) {
59902
- const templates = filter(types, isPatternLiteralType);
60327
+ const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
59903
60328
  if (templates.length) {
59904
60329
  let i = types.length;
59905
60330
  while (i > 0) {
@@ -68422,10 +68847,12 @@ function createTypeChecker(host) {
68422
68847
  }
68423
68848
  function isConstantReference(node) {
68424
68849
  switch (node.kind) {
68425
- case 79 /* Identifier */: {
68426
- const symbol = getResolvedSymbol(node);
68427
- return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
68428
- }
68850
+ case 79 /* Identifier */:
68851
+ if (!isThisInTypeQuery(node)) {
68852
+ const symbol = getResolvedSymbol(node);
68853
+ return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
68854
+ }
68855
+ break;
68429
68856
  case 208 /* PropertyAccessExpression */:
68430
68857
  case 209 /* ElementAccessExpression */:
68431
68858
  return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol);
@@ -72669,26 +73096,22 @@ function createTypeChecker(host) {
72669
73096
  function getSuggestedLibForNonExistentName(name) {
72670
73097
  const missingName = diagnosticName(name);
72671
73098
  const allFeatures = getScriptTargetFeatures();
72672
- const libTargets = getOwnKeys(allFeatures);
72673
- for (const libTarget of libTargets) {
72674
- const containingTypes = getOwnKeys(allFeatures[libTarget]);
72675
- if (containingTypes !== void 0 && contains(containingTypes, missingName)) {
72676
- return libTarget;
72677
- }
72678
- }
73099
+ const typeFeatures = allFeatures.get(missingName);
73100
+ return typeFeatures && firstIterator(typeFeatures.keys());
72679
73101
  }
72680
73102
  function getSuggestedLibForNonExistentProperty(missingProperty, containingType) {
72681
73103
  const container = getApparentType(containingType).symbol;
72682
73104
  if (!container) {
72683
73105
  return void 0;
72684
73106
  }
73107
+ const containingTypeName = symbolName(container);
72685
73108
  const allFeatures = getScriptTargetFeatures();
72686
- const libTargets = getOwnKeys(allFeatures);
72687
- for (const libTarget of libTargets) {
72688
- const featuresOfLib = allFeatures[libTarget];
72689
- const featuresOfContainingType = featuresOfLib[symbolName(container)];
72690
- if (featuresOfContainingType !== void 0 && contains(featuresOfContainingType, missingProperty)) {
72691
- return libTarget;
73109
+ const typeFeatures = allFeatures.get(containingTypeName);
73110
+ if (typeFeatures) {
73111
+ for (const [libTarget, featuresOfType] of typeFeatures) {
73112
+ if (contains(featuresOfType, missingProperty)) {
73113
+ return libTarget;
73114
+ }
72692
73115
  }
72693
73116
  }
72694
73117
  }
@@ -85146,6 +85569,7 @@ function createTypeChecker(host) {
85146
85569
  let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator;
85147
85570
  let flags = 0 /* None */;
85148
85571
  let sawExportBeforeDecorators = false;
85572
+ let hasLeadingDecorators = false;
85149
85573
  for (const modifier of node.modifiers) {
85150
85574
  if (isDecorator(modifier)) {
85151
85575
  if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) {
@@ -85163,8 +85587,22 @@ function createTypeChecker(host) {
85163
85587
  if (flags & ~(1025 /* ExportDefault */ | 131072 /* Decorator */)) {
85164
85588
  return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here);
85165
85589
  }
85590
+ if (hasLeadingDecorators && flags & 126975 /* Modifier */) {
85591
+ Debug.assertIsDefined(firstDecorator);
85592
+ const sourceFile = getSourceFileOfNode(modifier);
85593
+ if (!hasParseDiagnostics(sourceFile)) {
85594
+ addRelatedInfo(
85595
+ error(modifier, Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),
85596
+ createDiagnosticForNode(firstDecorator, Diagnostics.Decorator_used_before_export_here)
85597
+ );
85598
+ return true;
85599
+ }
85600
+ return false;
85601
+ }
85166
85602
  flags |= 131072 /* Decorator */;
85167
- if (flags & 1 /* Export */) {
85603
+ if (!(flags & 126975 /* Modifier */)) {
85604
+ hasLeadingDecorators = true;
85605
+ } else if (flags & 1 /* Export */) {
85168
85606
  sawExportBeforeDecorators = true;
85169
85607
  }
85170
85608
  firstDecorator != null ? firstDecorator : firstDecorator = modifier;
@@ -118327,11 +118765,19 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
118327
118765
  diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
118328
118766
  } else if (isClassDeclaration(parent2)) {
118329
118767
  const exportIndex = findIndex(parent2.modifiers, isExportModifier);
118330
- const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier);
118331
- if (exportIndex >= 0 && decoratorIndex < exportIndex) {
118332
- diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_must_come_after_export_or_export_default_in_JavaScript_files));
118333
- } else if (defaultIndex >= 0 && decoratorIndex < defaultIndex) {
118334
- diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
118768
+ if (exportIndex >= 0) {
118769
+ const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier);
118770
+ if (decoratorIndex > exportIndex && defaultIndex >= 0 && decoratorIndex < defaultIndex) {
118771
+ diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
118772
+ } else if (exportIndex >= 0 && decoratorIndex < exportIndex) {
118773
+ const trailingDecoratorIndex = findIndex(parent2.modifiers, isDecorator, exportIndex);
118774
+ if (trailingDecoratorIndex >= 0) {
118775
+ diagnostics.push(addRelatedInfo(
118776
+ createDiagnosticForNode2(parent2.modifiers[trailingDecoratorIndex], Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),
118777
+ createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorator_used_before_export_here)
118778
+ ));
118779
+ }
118780
+ }
118335
118781
  }
118336
118782
  }
118337
118783
  }
@@ -129437,10 +129883,13 @@ function needsNameFromDeclaration(symbol) {
129437
129883
  return !(symbol.flags & 33554432 /* Transient */) && (symbol.escapedName === "export=" /* ExportEquals */ || symbol.escapedName === "default" /* Default */);
129438
129884
  }
129439
129885
  function getDefaultLikeExportNameFromDeclaration(symbol) {
129440
- return firstDefined(symbol.declarations, (d) => {
129441
- var _a2;
129442
- return isExportAssignment(d) ? (_a2 = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a2.text : void 0;
129443
- });
129886
+ return firstDefined(
129887
+ symbol.declarations,
129888
+ (d) => {
129889
+ var _a2, _b;
129890
+ return isExportAssignment(d) ? (_a2 = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a2.text : (_b = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _b.text;
129891
+ }
129892
+ );
129444
129893
  }
129445
129894
  function getSymbolParentOrFail(symbol) {
129446
129895
  var _a2;
@@ -129821,13 +130270,25 @@ function forEachExternalModuleToImportFrom(program, host, preferences, useAutoIm
129821
130270
  const autoImportProvider = useAutoImportProvider && ((_a2 = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a2.call(host));
129822
130271
  if (autoImportProvider) {
129823
130272
  const start2 = timestamp();
129824
- forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, (module2, file) => cb(
129825
- module2,
129826
- file,
129827
- autoImportProvider,
129828
- /*isFromPackageJson*/
129829
- true
129830
- ));
130273
+ const checker = program.getTypeChecker();
130274
+ forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, (module2, file) => {
130275
+ if (file && !program.getSourceFile(file.fileName) || !file && !checker.resolveName(
130276
+ module2.name,
130277
+ /*location*/
130278
+ void 0,
130279
+ 1536 /* Module */,
130280
+ /*excludeGlobals*/
130281
+ false
130282
+ )) {
130283
+ cb(
130284
+ module2,
130285
+ file,
130286
+ autoImportProvider,
130287
+ /*isFromPackageJson*/
130288
+ true
130289
+ );
130290
+ }
130291
+ });
129831
130292
  (_b = host.log) == null ? void 0 : _b.call(host, `forEachExternalModuleToImportFrom autoImportProvider: ${timestamp() - start2}`);
129832
130293
  }
129833
130294
  }
@@ -143376,7 +143837,7 @@ function tryGetValueFromType(context, checker, importAdder, quotePreference, typ
143376
143837
  }
143377
143838
  if (isObjectLiteralType(type)) {
143378
143839
  const props = map(checker.getPropertiesOfType(type), (prop) => {
143379
- const initializer = prop.valueDeclaration ? tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeAtLocation(prop.valueDeclaration), enclosingDeclaration) : createUndefined();
143840
+ const initializer = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop), enclosingDeclaration);
143380
143841
  return factory.createPropertyAssignment(prop.name, initializer);
143381
143842
  });
143382
143843
  return factory.createObjectLiteralExpression(
@@ -149973,7 +150434,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
149973
150434
  return false;
149974
150435
  }
149975
150436
  function isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) {
149976
- return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(createTextRangeFromSpan(createTextSpanFromNode(contextToken2)), position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2)));
150437
+ return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(contextToken2, position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2)));
149977
150438
  }
149978
150439
  function tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() {
149979
150440
  const typeLiteralNode = tryGetTypeLiteralNode(contextToken);