@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/tsc.js CHANGED
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.0";
26
- var version = `${versionMajorMinor}.0-insiders.20230208`;
26
+ var version = `${versionMajorMinor}.0-insiders.20230210`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -614,6 +614,12 @@ function first(array) {
614
614
  Debug.assert(array.length !== 0);
615
615
  return array[0];
616
616
  }
617
+ function firstIterator(iter) {
618
+ for (const value of iter) {
619
+ return value;
620
+ }
621
+ Debug.fail("iterator is empty");
622
+ }
617
623
  function lastOrUndefined(array) {
618
624
  return array === void 0 || array.length === 0 ? void 0 : array[array.length - 1];
619
625
  }
@@ -6174,6 +6180,7 @@ var Diagnostics = {
6174
6180
  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" }`.'),
6175
6181
  _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."),
6176
6182
  _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."),
6183
+ Decorator_used_before_export_here: diag(1486, 1 /* Error */, "Decorator_used_before_export_here_1486", "Decorator used before 'export' here."),
6177
6184
  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."),
6178
6185
  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."),
6179
6186
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -7530,7 +7537,7 @@ var Diagnostics = {
7530
7537
  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."),
7531
7538
  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."),
7532
7539
  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."),
7533
- 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."),
7540
+ 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'."),
7534
7541
  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."),
7535
7542
  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."),
7536
7543
  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'."),
@@ -11650,101 +11657,400 @@ function getInternalEmitFlags(node) {
11650
11657
  return emitNode && emitNode.internalFlags || 0;
11651
11658
  }
11652
11659
  function getScriptTargetFeatures() {
11653
- return {
11654
- es2015: {
11655
- Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"],
11656
- RegExp: ["flags", "sticky", "unicode"],
11657
- Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get", " getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"],
11658
- ArrayConstructor: ["from", "of"],
11659
- ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"],
11660
- NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"],
11661
- Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"],
11662
- Map: ["entries", "keys", "values"],
11663
- Set: ["entries", "keys", "values"],
11664
- Promise: emptyArray,
11665
- PromiseConstructor: ["all", "race", "reject", "resolve"],
11666
- Symbol: ["for", "keyFor"],
11667
- WeakMap: ["entries", "keys", "values"],
11668
- WeakSet: ["entries", "keys", "values"],
11669
- Iterator: emptyArray,
11670
- AsyncIterator: emptyArray,
11671
- String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"],
11672
- StringConstructor: ["fromCodePoint", "raw"]
11673
- },
11674
- es2016: {
11675
- Array: ["includes"]
11676
- },
11677
- es2017: {
11678
- Atomics: emptyArray,
11679
- SharedArrayBuffer: emptyArray,
11680
- String: ["padStart", "padEnd"],
11681
- ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"],
11682
- DateTimeFormat: ["formatToParts"]
11683
- },
11684
- es2018: {
11685
- Promise: ["finally"],
11686
- RegExpMatchArray: ["groups"],
11687
- RegExpExecArray: ["groups"],
11688
- RegExp: ["dotAll"],
11689
- Intl: ["PluralRules"],
11690
- AsyncIterable: emptyArray,
11691
- AsyncIterableIterator: emptyArray,
11692
- AsyncGenerator: emptyArray,
11693
- AsyncGeneratorFunction: emptyArray,
11694
- NumberFormat: ["formatToParts"]
11695
- },
11696
- es2019: {
11697
- Array: ["flat", "flatMap"],
11698
- ObjectConstructor: ["fromEntries"],
11699
- String: ["trimStart", "trimEnd", "trimLeft", "trimRight"],
11700
- Symbol: ["description"]
11701
- },
11702
- es2020: {
11703
- BigInt: emptyArray,
11704
- BigInt64Array: emptyArray,
11705
- BigUint64Array: emptyArray,
11706
- PromiseConstructor: ["allSettled"],
11707
- SymbolConstructor: ["matchAll"],
11708
- String: ["matchAll"],
11709
- DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"],
11710
- RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"]
11711
- },
11712
- es2021: {
11713
- PromiseConstructor: ["any"],
11714
- String: ["replaceAll"]
11715
- },
11716
- es2022: {
11717
- Array: ["at"],
11718
- String: ["at"],
11719
- Int8Array: ["at"],
11720
- Uint8Array: ["at"],
11721
- Uint8ClampedArray: ["at"],
11722
- Int16Array: ["at"],
11723
- Uint16Array: ["at"],
11724
- Int32Array: ["at"],
11725
- Uint32Array: ["at"],
11726
- Float32Array: ["at"],
11727
- Float64Array: ["at"],
11728
- BigInt64Array: ["at"],
11729
- BigUint64Array: ["at"],
11730
- ObjectConstructor: ["hasOwn"],
11731
- Error: ["cause"]
11732
- },
11733
- es2023: {
11734
- Array: ["findLastIndex", "findLast"],
11735
- Int8Array: ["findLastIndex", "findLast"],
11736
- Uint8Array: ["findLastIndex", "findLast"],
11737
- Uint8ClampedArray: ["findLastIndex", "findLast"],
11738
- Int16Array: ["findLastIndex", "findLast"],
11739
- Uint16Array: ["findLastIndex", "findLast"],
11740
- Int32Array: ["findLastIndex", "findLast"],
11741
- Uint32Array: ["findLastIndex", "findLast"],
11742
- Float32Array: ["findLastIndex", "findLast"],
11743
- Float64Array: ["findLastIndex", "findLast"],
11744
- BigInt64Array: ["findLastIndex", "findLast"],
11745
- BigUint64Array: ["findLastIndex", "findLast"]
11746
- }
11747
- };
11660
+ return new Map(Object.entries({
11661
+ Array: new Map(Object.entries({
11662
+ es2015: [
11663
+ "find",
11664
+ "findIndex",
11665
+ "fill",
11666
+ "copyWithin",
11667
+ "entries",
11668
+ "keys",
11669
+ "values"
11670
+ ],
11671
+ es2016: [
11672
+ "includes"
11673
+ ],
11674
+ es2019: [
11675
+ "flat",
11676
+ "flatMap"
11677
+ ],
11678
+ es2022: [
11679
+ "at"
11680
+ ],
11681
+ es2023: [
11682
+ "findLastIndex",
11683
+ "findLast"
11684
+ ]
11685
+ })),
11686
+ Iterator: new Map(Object.entries({
11687
+ es2015: emptyArray
11688
+ })),
11689
+ AsyncIterator: new Map(Object.entries({
11690
+ es2015: emptyArray
11691
+ })),
11692
+ Atomics: new Map(Object.entries({
11693
+ es2017: emptyArray
11694
+ })),
11695
+ SharedArrayBuffer: new Map(Object.entries({
11696
+ es2017: emptyArray
11697
+ })),
11698
+ AsyncIterable: new Map(Object.entries({
11699
+ es2018: emptyArray
11700
+ })),
11701
+ AsyncIterableIterator: new Map(Object.entries({
11702
+ es2018: emptyArray
11703
+ })),
11704
+ AsyncGenerator: new Map(Object.entries({
11705
+ es2018: emptyArray
11706
+ })),
11707
+ AsyncGeneratorFunction: new Map(Object.entries({
11708
+ es2018: emptyArray
11709
+ })),
11710
+ RegExp: new Map(Object.entries({
11711
+ es2015: [
11712
+ "flags",
11713
+ "sticky",
11714
+ "unicode"
11715
+ ],
11716
+ es2018: [
11717
+ "dotAll"
11718
+ ]
11719
+ })),
11720
+ Reflect: new Map(Object.entries({
11721
+ es2015: [
11722
+ "apply",
11723
+ "construct",
11724
+ "defineProperty",
11725
+ "deleteProperty",
11726
+ "get",
11727
+ " getOwnPropertyDescriptor",
11728
+ "getPrototypeOf",
11729
+ "has",
11730
+ "isExtensible",
11731
+ "ownKeys",
11732
+ "preventExtensions",
11733
+ "set",
11734
+ "setPrototypeOf"
11735
+ ]
11736
+ })),
11737
+ ArrayConstructor: new Map(Object.entries({
11738
+ es2015: [
11739
+ "from",
11740
+ "of"
11741
+ ]
11742
+ })),
11743
+ ObjectConstructor: new Map(Object.entries({
11744
+ es2015: [
11745
+ "assign",
11746
+ "getOwnPropertySymbols",
11747
+ "keys",
11748
+ "is",
11749
+ "setPrototypeOf"
11750
+ ],
11751
+ es2017: [
11752
+ "values",
11753
+ "entries",
11754
+ "getOwnPropertyDescriptors"
11755
+ ],
11756
+ es2019: [
11757
+ "fromEntries"
11758
+ ],
11759
+ es2022: [
11760
+ "hasOwn"
11761
+ ]
11762
+ })),
11763
+ NumberConstructor: new Map(Object.entries({
11764
+ es2015: [
11765
+ "isFinite",
11766
+ "isInteger",
11767
+ "isNaN",
11768
+ "isSafeInteger",
11769
+ "parseFloat",
11770
+ "parseInt"
11771
+ ]
11772
+ })),
11773
+ Math: new Map(Object.entries({
11774
+ es2015: [
11775
+ "clz32",
11776
+ "imul",
11777
+ "sign",
11778
+ "log10",
11779
+ "log2",
11780
+ "log1p",
11781
+ "expm1",
11782
+ "cosh",
11783
+ "sinh",
11784
+ "tanh",
11785
+ "acosh",
11786
+ "asinh",
11787
+ "atanh",
11788
+ "hypot",
11789
+ "trunc",
11790
+ "fround",
11791
+ "cbrt"
11792
+ ]
11793
+ })),
11794
+ Map: new Map(Object.entries({
11795
+ es2015: [
11796
+ "entries",
11797
+ "keys",
11798
+ "values"
11799
+ ]
11800
+ })),
11801
+ Set: new Map(Object.entries({
11802
+ es2015: [
11803
+ "entries",
11804
+ "keys",
11805
+ "values"
11806
+ ]
11807
+ })),
11808
+ PromiseConstructor: new Map(Object.entries({
11809
+ es2015: [
11810
+ "all",
11811
+ "race",
11812
+ "reject",
11813
+ "resolve"
11814
+ ],
11815
+ es2020: [
11816
+ "allSettled"
11817
+ ],
11818
+ es2021: [
11819
+ "any"
11820
+ ]
11821
+ })),
11822
+ Symbol: new Map(Object.entries({
11823
+ es2015: [
11824
+ "for",
11825
+ "keyFor"
11826
+ ],
11827
+ es2019: [
11828
+ "description"
11829
+ ]
11830
+ })),
11831
+ WeakMap: new Map(Object.entries({
11832
+ es2015: [
11833
+ "entries",
11834
+ "keys",
11835
+ "values"
11836
+ ]
11837
+ })),
11838
+ WeakSet: new Map(Object.entries({
11839
+ es2015: [
11840
+ "entries",
11841
+ "keys",
11842
+ "values"
11843
+ ]
11844
+ })),
11845
+ String: new Map(Object.entries({
11846
+ es2015: [
11847
+ "codePointAt",
11848
+ "includes",
11849
+ "endsWith",
11850
+ "normalize",
11851
+ "repeat",
11852
+ "startsWith",
11853
+ "anchor",
11854
+ "big",
11855
+ "blink",
11856
+ "bold",
11857
+ "fixed",
11858
+ "fontcolor",
11859
+ "fontsize",
11860
+ "italics",
11861
+ "link",
11862
+ "small",
11863
+ "strike",
11864
+ "sub",
11865
+ "sup"
11866
+ ],
11867
+ es2017: [
11868
+ "padStart",
11869
+ "padEnd"
11870
+ ],
11871
+ es2019: [
11872
+ "trimStart",
11873
+ "trimEnd",
11874
+ "trimLeft",
11875
+ "trimRight"
11876
+ ],
11877
+ es2020: [
11878
+ "matchAll"
11879
+ ],
11880
+ es2021: [
11881
+ "replaceAll"
11882
+ ],
11883
+ es2022: [
11884
+ "at"
11885
+ ]
11886
+ })),
11887
+ StringConstructor: new Map(Object.entries({
11888
+ es2015: [
11889
+ "fromCodePoint",
11890
+ "raw"
11891
+ ]
11892
+ })),
11893
+ DateTimeFormat: new Map(Object.entries({
11894
+ es2017: [
11895
+ "formatToParts"
11896
+ ]
11897
+ })),
11898
+ Promise: new Map(Object.entries({
11899
+ es2015: emptyArray,
11900
+ es2018: [
11901
+ "finally"
11902
+ ]
11903
+ })),
11904
+ RegExpMatchArray: new Map(Object.entries({
11905
+ es2018: [
11906
+ "groups"
11907
+ ]
11908
+ })),
11909
+ RegExpExecArray: new Map(Object.entries({
11910
+ es2018: [
11911
+ "groups"
11912
+ ]
11913
+ })),
11914
+ Intl: new Map(Object.entries({
11915
+ es2018: [
11916
+ "PluralRules"
11917
+ ]
11918
+ })),
11919
+ NumberFormat: new Map(Object.entries({
11920
+ es2018: [
11921
+ "formatToParts"
11922
+ ]
11923
+ })),
11924
+ SymbolConstructor: new Map(Object.entries({
11925
+ es2020: [
11926
+ "matchAll"
11927
+ ]
11928
+ })),
11929
+ DataView: new Map(Object.entries({
11930
+ es2020: [
11931
+ "setBigInt64",
11932
+ "setBigUint64",
11933
+ "getBigInt64",
11934
+ "getBigUint64"
11935
+ ]
11936
+ })),
11937
+ BigInt: new Map(Object.entries({
11938
+ es2020: emptyArray
11939
+ })),
11940
+ RelativeTimeFormat: new Map(Object.entries({
11941
+ es2020: [
11942
+ "format",
11943
+ "formatToParts",
11944
+ "resolvedOptions"
11945
+ ]
11946
+ })),
11947
+ Int8Array: new Map(Object.entries({
11948
+ es2022: [
11949
+ "at"
11950
+ ],
11951
+ es2023: [
11952
+ "findLastIndex",
11953
+ "findLast"
11954
+ ]
11955
+ })),
11956
+ Uint8Array: new Map(Object.entries({
11957
+ es2022: [
11958
+ "at"
11959
+ ],
11960
+ es2023: [
11961
+ "findLastIndex",
11962
+ "findLast"
11963
+ ]
11964
+ })),
11965
+ Uint8ClampedArray: new Map(Object.entries({
11966
+ es2022: [
11967
+ "at"
11968
+ ],
11969
+ es2023: [
11970
+ "findLastIndex",
11971
+ "findLast"
11972
+ ]
11973
+ })),
11974
+ Int16Array: new Map(Object.entries({
11975
+ es2022: [
11976
+ "at"
11977
+ ],
11978
+ es2023: [
11979
+ "findLastIndex",
11980
+ "findLast"
11981
+ ]
11982
+ })),
11983
+ Uint16Array: new Map(Object.entries({
11984
+ es2022: [
11985
+ "at"
11986
+ ],
11987
+ es2023: [
11988
+ "findLastIndex",
11989
+ "findLast"
11990
+ ]
11991
+ })),
11992
+ Int32Array: new Map(Object.entries({
11993
+ es2022: [
11994
+ "at"
11995
+ ],
11996
+ es2023: [
11997
+ "findLastIndex",
11998
+ "findLast"
11999
+ ]
12000
+ })),
12001
+ Uint32Array: new Map(Object.entries({
12002
+ es2022: [
12003
+ "at"
12004
+ ],
12005
+ es2023: [
12006
+ "findLastIndex",
12007
+ "findLast"
12008
+ ]
12009
+ })),
12010
+ Float32Array: new Map(Object.entries({
12011
+ es2022: [
12012
+ "at"
12013
+ ],
12014
+ es2023: [
12015
+ "findLastIndex",
12016
+ "findLast"
12017
+ ]
12018
+ })),
12019
+ Float64Array: new Map(Object.entries({
12020
+ es2022: [
12021
+ "at"
12022
+ ],
12023
+ es2023: [
12024
+ "findLastIndex",
12025
+ "findLast"
12026
+ ]
12027
+ })),
12028
+ BigInt64Array: new Map(Object.entries({
12029
+ es2020: emptyArray,
12030
+ es2022: [
12031
+ "at"
12032
+ ],
12033
+ es2023: [
12034
+ "findLastIndex",
12035
+ "findLast"
12036
+ ]
12037
+ })),
12038
+ BigUint64Array: new Map(Object.entries({
12039
+ es2020: emptyArray,
12040
+ es2022: [
12041
+ "at"
12042
+ ],
12043
+ es2023: [
12044
+ "findLastIndex",
12045
+ "findLast"
12046
+ ]
12047
+ })),
12048
+ Error: new Map(Object.entries({
12049
+ es2022: [
12050
+ "cause"
12051
+ ]
12052
+ }))
12053
+ }));
11748
12054
  }
11749
12055
  function getLiteralText(node, sourceFile, flags) {
11750
12056
  var _a2;
@@ -22501,14 +22807,114 @@ function createEmitHelperFactory(context) {
22501
22807
  factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name)
22502
22808
  ]);
22503
22809
  }
22810
+ function createESDecorateClassElementAccessGetMethod(elementName) {
22811
+ const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name);
22812
+ return factory2.createPropertyAssignment(
22813
+ "get",
22814
+ factory2.createArrowFunction(
22815
+ /*modifiers*/
22816
+ void 0,
22817
+ /*typeParameters*/
22818
+ void 0,
22819
+ [factory2.createParameterDeclaration(
22820
+ /*modifiers*/
22821
+ void 0,
22822
+ /*dotDotDotToken*/
22823
+ void 0,
22824
+ factory2.createIdentifier("obj")
22825
+ )],
22826
+ /*type*/
22827
+ void 0,
22828
+ /*equalsGreaterThanToken*/
22829
+ void 0,
22830
+ accessor
22831
+ )
22832
+ );
22833
+ }
22834
+ function createESDecorateClassElementAccessSetMethod(elementName) {
22835
+ const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name);
22836
+ return factory2.createPropertyAssignment(
22837
+ "set",
22838
+ factory2.createArrowFunction(
22839
+ /*modifiers*/
22840
+ void 0,
22841
+ /*typeParameters*/
22842
+ void 0,
22843
+ [
22844
+ factory2.createParameterDeclaration(
22845
+ /*modifiers*/
22846
+ void 0,
22847
+ /*dotDotDotToken*/
22848
+ void 0,
22849
+ factory2.createIdentifier("obj")
22850
+ ),
22851
+ factory2.createParameterDeclaration(
22852
+ /*modifiers*/
22853
+ void 0,
22854
+ /*dotDotDotToken*/
22855
+ void 0,
22856
+ factory2.createIdentifier("value")
22857
+ )
22858
+ ],
22859
+ /*type*/
22860
+ void 0,
22861
+ /*equalsGreaterThanToken*/
22862
+ void 0,
22863
+ factory2.createBlock([
22864
+ factory2.createExpressionStatement(
22865
+ factory2.createAssignment(
22866
+ accessor,
22867
+ factory2.createIdentifier("value")
22868
+ )
22869
+ )
22870
+ ])
22871
+ )
22872
+ );
22873
+ }
22874
+ function createESDecorateClassElementAccessHasMethod(elementName) {
22875
+ const propertyName = elementName.computed ? elementName.name : isIdentifier(elementName.name) ? factory2.createStringLiteralFromNode(elementName.name) : elementName.name;
22876
+ return factory2.createPropertyAssignment(
22877
+ "has",
22878
+ factory2.createArrowFunction(
22879
+ /*modifiers*/
22880
+ void 0,
22881
+ /*typeParameters*/
22882
+ void 0,
22883
+ [factory2.createParameterDeclaration(
22884
+ /*modifiers*/
22885
+ void 0,
22886
+ /*dotDotDotToken*/
22887
+ void 0,
22888
+ factory2.createIdentifier("obj")
22889
+ )],
22890
+ /*type*/
22891
+ void 0,
22892
+ /*equalsGreaterThanToken*/
22893
+ void 0,
22894
+ factory2.createBinaryExpression(
22895
+ propertyName,
22896
+ 101 /* InKeyword */,
22897
+ factory2.createIdentifier("obj")
22898
+ )
22899
+ )
22900
+ );
22901
+ }
22902
+ function createESDecorateClassElementAccessObject(name, access) {
22903
+ const properties = [];
22904
+ properties.push(createESDecorateClassElementAccessHasMethod(name));
22905
+ if (access.get)
22906
+ properties.push(createESDecorateClassElementAccessGetMethod(name));
22907
+ if (access.set)
22908
+ properties.push(createESDecorateClassElementAccessSetMethod(name));
22909
+ return factory2.createObjectLiteralExpression(properties);
22910
+ }
22504
22911
  function createESDecorateClassElementContextObject(contextIn) {
22505
22912
  return factory2.createObjectLiteralExpression([
22506
22913
  factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral(contextIn.kind)),
22507
22914
  factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name.computed ? contextIn.name.name : factory2.createStringLiteralFromNode(contextIn.name.name)),
22508
22915
  factory2.createPropertyAssignment(factory2.createIdentifier("static"), contextIn.static ? factory2.createTrue() : factory2.createFalse()),
22509
- factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse())
22510
- // Disabled, pending resolution of https://github.com/tc39/proposal-decorators/issues/494
22511
- // factory.createPropertyAssignment(factory.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access))
22916
+ factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()),
22917
+ factory2.createPropertyAssignment(factory2.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access))
22512
22918
  ]);
22513
22919
  }
22514
22920
  function createESDecorateContextObject(contextIn) {
@@ -26686,8 +27092,13 @@ var Parser;
26686
27092
  return tokenIsIdentifierOrKeyword(token()) || token() === 18 /* OpenBraceToken */;
26687
27093
  case 14 /* JsxChildren */:
26688
27094
  return true;
27095
+ case 25 /* StandaloneJSDoc */:
27096
+ return true;
27097
+ case 26 /* Count */:
27098
+ return Debug.fail("ParsingContext.Count used as a context");
27099
+ default:
27100
+ Debug.assertNever(parsingContext2, "Non-exhaustive case in 'isListElement'.");
26689
27101
  }
26690
- return Debug.fail("Non-exhaustive case in 'isListElement'.");
26691
27102
  }
26692
27103
  function isValidHeritageClauseObjectLiteral() {
26693
27104
  Debug.assert(token() === 18 /* OpenBraceToken */);
@@ -26781,7 +27192,8 @@ var Parser;
26781
27192
  return false;
26782
27193
  }
26783
27194
  function isInSomeParsingContext() {
26784
- for (let kind = 0; kind < 25 /* Count */; kind++) {
27195
+ Debug.assert(parsingContext, "Missing parsing context");
27196
+ for (let kind = 0; kind < 26 /* Count */; kind++) {
26785
27197
  if (parsingContext & 1 << kind) {
26786
27198
  if (isListElement(
26787
27199
  kind,
@@ -26860,6 +27272,7 @@ var Parser;
26860
27272
  case 8 /* VariableDeclarations */:
26861
27273
  case 17 /* JSDocParameters */:
26862
27274
  case 16 /* Parameters */:
27275
+ case 25 /* StandaloneJSDoc */:
26863
27276
  return true;
26864
27277
  }
26865
27278
  return false;
@@ -27040,7 +27453,9 @@ var Parser;
27040
27453
  return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
27041
27454
  case 24 /* AssertEntries */:
27042
27455
  return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
27043
- case 25 /* Count */:
27456
+ case 25 /* StandaloneJSDoc */:
27457
+ return;
27458
+ case 26 /* Count */:
27044
27459
  return Debug.fail("ParsingContext.Count used as a context");
27045
27460
  default:
27046
27461
  Debug.assertNever(context);
@@ -28822,7 +29237,7 @@ var Parser;
28822
29237
  case 114 /* VoidKeyword */:
28823
29238
  return parseVoidExpression();
28824
29239
  case 29 /* LessThanToken */:
28825
- if (languageVariant === 1 /* JSX */ && token() === 29 /* LessThanToken */ && lookAhead(nextTokenIsIdentifierOrKeywordOrGreaterThan)) {
29240
+ if (languageVariant === 1 /* JSX */) {
28826
29241
  return parseJsxElementOrSelfClosingElementOrFragment(
28827
29242
  /*inExpressionContext*/
28828
29243
  true
@@ -29199,7 +29614,7 @@ var Parser;
29199
29614
  return finishNode(factory2.createJsxJsxClosingFragment(), pos);
29200
29615
  }
29201
29616
  function parseTypeAssertion() {
29202
- 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.");
29617
+ Debug.assert(scriptKind === 3 /* TS */, "Type assertions should never be parsed outside of TS; they should either be comparisons or JSX.");
29203
29618
  const pos = getNodePos();
29204
29619
  parseExpected(29 /* LessThanToken */);
29205
29620
  const type = parseType();
@@ -30550,17 +30965,25 @@ var Parser;
30550
30965
  function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) {
30551
30966
  const pos = getNodePos();
30552
30967
  let list;
30553
- let modifier, hasSeenStaticModifier = false;
30968
+ let decorator, modifier, hasSeenStaticModifier = false, hasLeadingModifier = false, hasTrailingDecorator = false;
30969
+ if (allowDecorators && token() === 59 /* AtToken */) {
30970
+ while (decorator = tryParseDecorator()) {
30971
+ list = append(list, decorator);
30972
+ }
30973
+ }
30554
30974
  while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) {
30555
30975
  if (modifier.kind === 124 /* StaticKeyword */)
30556
30976
  hasSeenStaticModifier = true;
30557
30977
  list = append(list, modifier);
30978
+ hasLeadingModifier = true;
30558
30979
  }
30559
- if (allowDecorators && token() === 59 /* AtToken */) {
30560
- let decorator;
30980
+ if (hasLeadingModifier && allowDecorators && token() === 59 /* AtToken */) {
30561
30981
  while (decorator = tryParseDecorator()) {
30562
30982
  list = append(list, decorator);
30983
+ hasTrailingDecorator = true;
30563
30984
  }
30985
+ }
30986
+ if (hasTrailingDecorator) {
30564
30987
  while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) {
30565
30988
  if (modifier.kind === 124 /* StaticKeyword */)
30566
30989
  hasSeenStaticModifier = true;
@@ -31132,7 +31555,8 @@ var Parser;
31132
31555
  ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
31133
31556
  ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
31134
31557
  ParsingContext2[ParsingContext2["AssertEntries"] = 24] = "AssertEntries";
31135
- ParsingContext2[ParsingContext2["Count"] = 25] = "Count";
31558
+ ParsingContext2[ParsingContext2["StandaloneJSDoc"] = 25] = "StandaloneJSDoc";
31559
+ ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
31136
31560
  })(ParsingContext || (ParsingContext = {}));
31137
31561
  let Tristate;
31138
31562
  ((Tristate2) => {
@@ -31254,6 +31678,13 @@ var Parser;
31254
31678
  PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter";
31255
31679
  })(PropertyLikeParse || (PropertyLikeParse = {}));
31256
31680
  function parseJSDocCommentWorker(start = 0, length2) {
31681
+ const saveParsingContext = parsingContext;
31682
+ parsingContext |= 1 << 25 /* StandaloneJSDoc */;
31683
+ const jsdoc = parseJSDocCommentWorkerWorker(start, length2);
31684
+ parsingContext = saveParsingContext;
31685
+ return jsdoc;
31686
+ }
31687
+ function parseJSDocCommentWorkerWorker(start, length2) {
31257
31688
  const content = sourceText;
31258
31689
  const end = length2 === void 0 ? content.length : start + length2;
31259
31690
  length2 = end - start;
@@ -55317,7 +55748,7 @@ function createTypeChecker(host) {
55317
55748
  }
55318
55749
  }
55319
55750
  function removeStringLiteralsMatchedByTemplateLiterals(types) {
55320
- const templates = filter(types, isPatternLiteralType);
55751
+ const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
55321
55752
  if (templates.length) {
55322
55753
  let i = types.length;
55323
55754
  while (i > 0) {
@@ -63840,10 +64271,12 @@ function createTypeChecker(host) {
63840
64271
  }
63841
64272
  function isConstantReference(node) {
63842
64273
  switch (node.kind) {
63843
- case 79 /* Identifier */: {
63844
- const symbol = getResolvedSymbol(node);
63845
- return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
63846
- }
64274
+ case 79 /* Identifier */:
64275
+ if (!isThisInTypeQuery(node)) {
64276
+ const symbol = getResolvedSymbol(node);
64277
+ return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
64278
+ }
64279
+ break;
63847
64280
  case 208 /* PropertyAccessExpression */:
63848
64281
  case 209 /* ElementAccessExpression */:
63849
64282
  return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol);
@@ -68087,26 +68520,22 @@ function createTypeChecker(host) {
68087
68520
  function getSuggestedLibForNonExistentName(name) {
68088
68521
  const missingName = diagnosticName(name);
68089
68522
  const allFeatures = getScriptTargetFeatures();
68090
- const libTargets = getOwnKeys(allFeatures);
68091
- for (const libTarget of libTargets) {
68092
- const containingTypes = getOwnKeys(allFeatures[libTarget]);
68093
- if (containingTypes !== void 0 && contains(containingTypes, missingName)) {
68094
- return libTarget;
68095
- }
68096
- }
68523
+ const typeFeatures = allFeatures.get(missingName);
68524
+ return typeFeatures && firstIterator(typeFeatures.keys());
68097
68525
  }
68098
68526
  function getSuggestedLibForNonExistentProperty(missingProperty, containingType) {
68099
68527
  const container = getApparentType(containingType).symbol;
68100
68528
  if (!container) {
68101
68529
  return void 0;
68102
68530
  }
68531
+ const containingTypeName = symbolName(container);
68103
68532
  const allFeatures = getScriptTargetFeatures();
68104
- const libTargets = getOwnKeys(allFeatures);
68105
- for (const libTarget of libTargets) {
68106
- const featuresOfLib = allFeatures[libTarget];
68107
- const featuresOfContainingType = featuresOfLib[symbolName(container)];
68108
- if (featuresOfContainingType !== void 0 && contains(featuresOfContainingType, missingProperty)) {
68109
- return libTarget;
68533
+ const typeFeatures = allFeatures.get(containingTypeName);
68534
+ if (typeFeatures) {
68535
+ for (const [libTarget, featuresOfType] of typeFeatures) {
68536
+ if (contains(featuresOfType, missingProperty)) {
68537
+ return libTarget;
68538
+ }
68110
68539
  }
68111
68540
  }
68112
68541
  }
@@ -80564,6 +80993,7 @@ function createTypeChecker(host) {
80564
80993
  let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator;
80565
80994
  let flags = 0 /* None */;
80566
80995
  let sawExportBeforeDecorators = false;
80996
+ let hasLeadingDecorators = false;
80567
80997
  for (const modifier of node.modifiers) {
80568
80998
  if (isDecorator(modifier)) {
80569
80999
  if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) {
@@ -80581,8 +81011,22 @@ function createTypeChecker(host) {
80581
81011
  if (flags & ~(1025 /* ExportDefault */ | 131072 /* Decorator */)) {
80582
81012
  return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here);
80583
81013
  }
81014
+ if (hasLeadingDecorators && flags & 126975 /* Modifier */) {
81015
+ Debug.assertIsDefined(firstDecorator);
81016
+ const sourceFile = getSourceFileOfNode(modifier);
81017
+ if (!hasParseDiagnostics(sourceFile)) {
81018
+ addRelatedInfo(
81019
+ error(modifier, Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),
81020
+ createDiagnosticForNode(firstDecorator, Diagnostics.Decorator_used_before_export_here)
81021
+ );
81022
+ return true;
81023
+ }
81024
+ return false;
81025
+ }
80584
81026
  flags |= 131072 /* Decorator */;
80585
- if (flags & 1 /* Export */) {
81027
+ if (!(flags & 126975 /* Modifier */)) {
81028
+ hasLeadingDecorators = true;
81029
+ } else if (flags & 1 /* Export */) {
80586
81030
  sawExportBeforeDecorators = true;
80587
81031
  }
80588
81032
  firstDecorator != null ? firstDecorator : firstDecorator = modifier;
@@ -113509,11 +113953,19 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
113509
113953
  diagnostics.push(createDiagnosticForNode2(parent.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
113510
113954
  } else if (isClassDeclaration(parent)) {
113511
113955
  const exportIndex = findIndex(parent.modifiers, isExportModifier);
113512
- const defaultIndex = findIndex(parent.modifiers, isDefaultModifier);
113513
- if (exportIndex >= 0 && decoratorIndex < exportIndex) {
113514
- diagnostics.push(createDiagnosticForNode2(parent.modifiers[decoratorIndex], Diagnostics.Decorators_must_come_after_export_or_export_default_in_JavaScript_files));
113515
- } else if (defaultIndex >= 0 && decoratorIndex < defaultIndex) {
113516
- diagnostics.push(createDiagnosticForNode2(parent.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
113956
+ if (exportIndex >= 0) {
113957
+ const defaultIndex = findIndex(parent.modifiers, isDefaultModifier);
113958
+ if (decoratorIndex > exportIndex && defaultIndex >= 0 && decoratorIndex < defaultIndex) {
113959
+ diagnostics.push(createDiagnosticForNode2(parent.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
113960
+ } else if (exportIndex >= 0 && decoratorIndex < exportIndex) {
113961
+ const trailingDecoratorIndex = findIndex(parent.modifiers, isDecorator, exportIndex);
113962
+ if (trailingDecoratorIndex >= 0) {
113963
+ diagnostics.push(addRelatedInfo(
113964
+ createDiagnosticForNode2(parent.modifiers[trailingDecoratorIndex], Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),
113965
+ createDiagnosticForNode2(parent.modifiers[decoratorIndex], Diagnostics.Decorator_used_before_export_here)
113966
+ ));
113967
+ }
113968
+ }
113517
113969
  }
113518
113970
  }
113519
113971
  }