typescript 5.0.0-dev.20230209 → 5.0.0-dev.20230210

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-dev.20230209`;
2290
+ var version = `${versionMajorMinor}.0-dev.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) {
@@ -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;
@@ -59892,7 +60307,7 @@ function createTypeChecker(host) {
59892
60307
  }
59893
60308
  }
59894
60309
  function removeStringLiteralsMatchedByTemplateLiterals(types) {
59895
- const templates = filter(types, isPatternLiteralType);
60310
+ const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
59896
60311
  if (templates.length) {
59897
60312
  let i = types.length;
59898
60313
  while (i > 0) {
@@ -68415,10 +68830,12 @@ function createTypeChecker(host) {
68415
68830
  }
68416
68831
  function isConstantReference(node) {
68417
68832
  switch (node.kind) {
68418
- case 79 /* Identifier */: {
68419
- const symbol = getResolvedSymbol(node);
68420
- return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
68421
- }
68833
+ case 79 /* Identifier */:
68834
+ if (!isThisInTypeQuery(node)) {
68835
+ const symbol = getResolvedSymbol(node);
68836
+ return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
68837
+ }
68838
+ break;
68422
68839
  case 208 /* PropertyAccessExpression */:
68423
68840
  case 209 /* ElementAccessExpression */:
68424
68841
  return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol);
@@ -72662,26 +73079,22 @@ function createTypeChecker(host) {
72662
73079
  function getSuggestedLibForNonExistentName(name) {
72663
73080
  const missingName = diagnosticName(name);
72664
73081
  const allFeatures = getScriptTargetFeatures();
72665
- const libTargets = getOwnKeys(allFeatures);
72666
- for (const libTarget of libTargets) {
72667
- const containingTypes = getOwnKeys(allFeatures[libTarget]);
72668
- if (containingTypes !== void 0 && contains(containingTypes, missingName)) {
72669
- return libTarget;
72670
- }
72671
- }
73082
+ const typeFeatures = allFeatures.get(missingName);
73083
+ return typeFeatures && firstIterator(typeFeatures.keys());
72672
73084
  }
72673
73085
  function getSuggestedLibForNonExistentProperty(missingProperty, containingType) {
72674
73086
  const container = getApparentType(containingType).symbol;
72675
73087
  if (!container) {
72676
73088
  return void 0;
72677
73089
  }
73090
+ const containingTypeName = symbolName(container);
72678
73091
  const allFeatures = getScriptTargetFeatures();
72679
- const libTargets = getOwnKeys(allFeatures);
72680
- for (const libTarget of libTargets) {
72681
- const featuresOfLib = allFeatures[libTarget];
72682
- const featuresOfContainingType = featuresOfLib[symbolName(container)];
72683
- if (featuresOfContainingType !== void 0 && contains(featuresOfContainingType, missingProperty)) {
72684
- return libTarget;
73092
+ const typeFeatures = allFeatures.get(containingTypeName);
73093
+ if (typeFeatures) {
73094
+ for (const [libTarget, featuresOfType] of typeFeatures) {
73095
+ if (contains(featuresOfType, missingProperty)) {
73096
+ return libTarget;
73097
+ }
72685
73098
  }
72686
73099
  }
72687
73100
  }
@@ -85139,6 +85552,7 @@ function createTypeChecker(host) {
85139
85552
  let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator;
85140
85553
  let flags = 0 /* None */;
85141
85554
  let sawExportBeforeDecorators = false;
85555
+ let hasLeadingDecorators = false;
85142
85556
  for (const modifier of node.modifiers) {
85143
85557
  if (isDecorator(modifier)) {
85144
85558
  if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) {
@@ -85156,8 +85570,22 @@ function createTypeChecker(host) {
85156
85570
  if (flags & ~(1025 /* ExportDefault */ | 131072 /* Decorator */)) {
85157
85571
  return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here);
85158
85572
  }
85573
+ if (hasLeadingDecorators && flags & 126975 /* Modifier */) {
85574
+ Debug.assertIsDefined(firstDecorator);
85575
+ const sourceFile = getSourceFileOfNode(modifier);
85576
+ if (!hasParseDiagnostics(sourceFile)) {
85577
+ addRelatedInfo(
85578
+ error(modifier, Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),
85579
+ createDiagnosticForNode(firstDecorator, Diagnostics.Decorator_used_before_export_here)
85580
+ );
85581
+ return true;
85582
+ }
85583
+ return false;
85584
+ }
85159
85585
  flags |= 131072 /* Decorator */;
85160
- if (flags & 1 /* Export */) {
85586
+ if (!(flags & 126975 /* Modifier */)) {
85587
+ hasLeadingDecorators = true;
85588
+ } else if (flags & 1 /* Export */) {
85161
85589
  sawExportBeforeDecorators = true;
85162
85590
  }
85163
85591
  firstDecorator != null ? firstDecorator : firstDecorator = modifier;
@@ -118320,11 +118748,19 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
118320
118748
  diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
118321
118749
  } else if (isClassDeclaration(parent2)) {
118322
118750
  const exportIndex = findIndex(parent2.modifiers, isExportModifier);
118323
- const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier);
118324
- if (exportIndex >= 0 && decoratorIndex < exportIndex) {
118325
- diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_must_come_after_export_or_export_default_in_JavaScript_files));
118326
- } else if (defaultIndex >= 0 && decoratorIndex < defaultIndex) {
118327
- diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
118751
+ if (exportIndex >= 0) {
118752
+ const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier);
118753
+ if (decoratorIndex > exportIndex && defaultIndex >= 0 && decoratorIndex < defaultIndex) {
118754
+ diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
118755
+ } else if (exportIndex >= 0 && decoratorIndex < exportIndex) {
118756
+ const trailingDecoratorIndex = findIndex(parent2.modifiers, isDecorator, exportIndex);
118757
+ if (trailingDecoratorIndex >= 0) {
118758
+ diagnostics.push(addRelatedInfo(
118759
+ createDiagnosticForNode2(parent2.modifiers[trailingDecoratorIndex], Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),
118760
+ createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorator_used_before_export_here)
118761
+ ));
118762
+ }
118763
+ }
118328
118764
  }
118329
118765
  }
118330
118766
  }
@@ -129430,10 +129866,13 @@ function needsNameFromDeclaration(symbol) {
129430
129866
  return !(symbol.flags & 33554432 /* Transient */) && (symbol.escapedName === "export=" /* ExportEquals */ || symbol.escapedName === "default" /* Default */);
129431
129867
  }
129432
129868
  function getDefaultLikeExportNameFromDeclaration(symbol) {
129433
- return firstDefined(symbol.declarations, (d) => {
129434
- var _a2;
129435
- return isExportAssignment(d) ? (_a2 = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a2.text : void 0;
129436
- });
129869
+ return firstDefined(
129870
+ symbol.declarations,
129871
+ (d) => {
129872
+ var _a2, _b;
129873
+ return isExportAssignment(d) ? (_a2 = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a2.text : (_b = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _b.text;
129874
+ }
129875
+ );
129437
129876
  }
129438
129877
  function getSymbolParentOrFail(symbol) {
129439
129878
  var _a2;
@@ -149978,7 +150417,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
149978
150417
  return false;
149979
150418
  }
149980
150419
  function isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) {
149981
- return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(createTextRangeFromSpan(createTextSpanFromNode(contextToken2)), position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2)));
150420
+ return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(contextToken2, position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2)));
149982
150421
  }
149983
150422
  function tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() {
149984
150423
  const typeLiteralNode = tryGetTypeLiteralNode(contextToken);